import{P as fe,a as W,b as oe,c as Ue,d as Le,e as Ge,fa as Re,ha as re,ia as he,ja as be,ka as we,la as Z,ma as Be,na as We,oa as dt,pa as H,qa as Ze}from"/_feather/build/_shared/chunk-ZSWFQFB4.js";import{m as Se,p as se}from"/_feather/build/_shared/chunk-MHKFAEJH.js";import{a as Fe,c as V,d as Ne,e as ne}from"/_feather/build/_shared/chunk-JOS5CKPX.js";import{a as ut}from"/_feather/build/_shared/chunk-5U4KSKRB.js";import{a as w}from"/_feather/build/_shared/chunk-7GEREZ56.js";import{b as ve,j as ke,l as He,p as pe,q as _e,x as ze}from"/_feather/build/_shared/chunk-YBOC6XNN.js";import{b as De,d as v}from"/_feather/build/_shared/chunk-6FRSWQKX.js";var at=De((Oe,tt)=>{(function(e,a){typeof define=="function"&&define.amd?define(a):typeof Oe=="object"?tt.exports=a():e.NProgress=a()})(Oe,function(){var e={};e.version="0.2.0";var a=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};e.configure=function(s){var r,c;for(r in s)c=s[r],c!==void 0&&s.hasOwnProperty(r)&&(a[r]=c);return this},e.status=null,e.set=function(s){var r=e.isStarted();s=t(s,a.minimum,1),e.status=s===1?null:s;var c=e.render(!r),u=c.querySelector(a.barSelector),P=a.speed,_=a.easing;return c.offsetWidth,l(function(m){a.positionUsing===""&&(a.positionUsing=e.getPositioningCSS()),i(u,d(s,P,_)),s===1?(i(c,{transition:"none",opacity:1}),c.offsetWidth,setTimeout(function(){i(c,{transition:"all "+P+"ms linear",opacity:0}),setTimeout(function(){e.remove(),m()},P)},P)):setTimeout(m,P)}),this},e.isStarted=function(){return typeof e.status=="number"},e.start=function(){e.status||e.set(0);var s=function(){setTimeout(function(){!e.status||(e.trickle(),s())},a.trickleSpeed)};return a.trickle&&s(),this},e.done=function(s){return!s&&!e.status?this:e.inc(.3+.5*Math.random()).set(1)},e.inc=function(s){var r=e.status;return r?(typeof s!="number"&&(s=(1-r)*t(Math.random()*r,.1,.95)),r=t(r+s,0,.994),e.set(r)):e.start()},e.trickle=function(){return e.inc(Math.random()*a.trickleRate)},function(){var s=0,r=0;e.promise=function(c){return!c||c.state()==="resolved"?this:(r===0&&e.start(),s++,r++,c.always(function(){r--,r===0?(s=0,e.done()):e.set((s-r)/s)}),this)}}(),e.render=function(s){if(e.isRendered())return document.getElementById("nprogress");g(document.documentElement,"nprogress-busy");var r=document.createElement("div");r.id="nprogress",r.innerHTML=a.template;var c=r.querySelector(a.barSelector),u=s?"-100":o(e.status||0),P=document.querySelector(a.parent),_;return i(c,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),a.showSpinner||(_=r.querySelector(a.spinnerSelector),_&&h(_)),P!=document.body&&g(P,"nprogress-custom-parent"),P.appendChild(r),r},e.remove=function(){p(document.documentElement,"nprogress-busy"),p(document.querySelector(a.parent),"nprogress-custom-parent");var s=document.getElementById("nprogress");s&&h(s)},e.isRendered=function(){return!!document.getElementById("nprogress")},e.getPositioningCSS=function(){var s=document.body.style,r="WebkitTransform"in s?"Webkit":"MozTransform"in s?"Moz":"msTransform"in s?"ms":"OTransform"in s?"O":"";return r+"Perspective"in s?"translate3d":r+"Transform"in s?"translate":"margin"};function t(s,r,c){return s<r?r:s>c?c:s}function o(s){return(-1+s)*100}function d(s,r,c){var u;return a.positionUsing==="translate3d"?u={transform:"translate3d("+o(s)+"%,0,0)"}:a.positionUsing==="translate"?u={transform:"translate("+o(s)+"%,0)"}:u={"margin-left":o(s)+"%"},u.transition="all "+r+"ms "+c,u}var l=function(){var s=[];function r(){var c=s.shift();c&&c(r)}return function(c){s.push(c),s.length==1&&r()}}(),i=function(){var s=["Webkit","O","Moz","ms"],r={};function c(m){return m.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(b,y){return y.toUpperCase()})}function u(m){var b=document.body.style;if(m in b)return m;for(var y=s.length,L=m.charAt(0).toUpperCase()+m.slice(1),S;y--;)if(S=s[y]+L,S in b)return S;return m}function P(m){return m=c(m),r[m]||(r[m]=u(m))}function _(m,b,y){b=P(b),m.style[b]=y}return function(m,b){var y=arguments,L,S;if(y.length==2)for(L in b)S=b[L],S!==void 0&&b.hasOwnProperty(L)&&_(m,L,S);else _(m,y[1],y[2])}}();function n(s,r){var c=typeof s=="string"?s:f(s);return c.indexOf(" "+r+" ")>=0}function g(s,r){var c=f(s),u=c+r;n(c,r)||(s.className=u.substring(1))}function p(s,r){var c=f(s),u;!n(s,r)||(u=c.replace(" "+r+" "," "),s.className=u.substring(1,u.length-1))}function f(s){return(" "+(s.className||"")+" ").replace(/\s+/gi," ")}function h(s){s&&s.parentNode&&s.parentNode.removeChild(s)}return e})});var st=De(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.useScript=void 0;var ot=ve();function ht(e){let[a,t]=ot.useState(e?"loading":"idle");return ot.useEffect(()=>{if(!e){t("idle");return}let o=document.querySelector(`script[src="${e}"]`);if(o)t(o.getAttribute("data-status"));else{o=document.createElement("script"),o.src=e,o.async=!0,o.setAttribute("data-status","loading"),document.body.appendChild(o);let l=i=>{o.setAttribute("data-status",i.type==="load"?"ready":"error")};o.addEventListener("load",l),o.addEventListener("error",l)}let d=l=>{t(l.type==="load"?"ready":"error")};return o.addEventListener("load",d),o.addEventListener("error",d),()=>{o&&(o.removeEventListener("load",d),o.removeEventListener("error",d))}},[e]),a}Ee.useScript=ht});var gt=v(ut());var de=v(w()),xe="a-z",ye="z-a";function Ve({openSearch:e}){var s,r,c,u,P,_,m,b,y,L,S,M,D,I,F,U,G,B;let{posts:a,tags:t,publication:o}=W(),d=_e(),{content:l,tags:i}=V({publication:o}),[n]=pe(),g=n.get("sortBy"),p=Ne(),f=H({publication:o});function h(){return t.sort((N,z)=>{if(g===l.plural){let q=be({tag:N,allPosts:a}).length,Q=be({tag:z,allPosts:a}).length;if(q!==Q)return Q-q}let X=N.title.toLocaleLowerCase(),j=z.title.toLocaleLowerCase(),ee=g===xe?1:g===ye?-1:0;return(X<j?-1:X>j?1:0)*ee})}return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(f.TagsTitle,{tagsDatabaseName:i,localization:{findAllTheTags:((r=(s=o.settings.localization)==null?void 0:s.tagsIndex)==null?void 0:r.findAllTheTags)||`Find all the ${i.plural}`,tagsDescription:((u=(c=o.settings.localization)==null?void 0:c.tagsIndex)==null?void 0:u.tagsDescription)||((_=(P=o.databases.tags)==null?void 0:P.page)==null?void 0:_.description)||"",searchPlaceholder:((b=(m=o.settings.localization)==null?void 0:m.search)==null?void 0:b.search)||"Search..."},tagsIndexPageLink:`/${p.generatedPages}${se({title:i.plural})}`,contentIndexPageLink:Z({publication:o,urlPrefixes:p}),openSearch:e}),(0,de.jsx)(f.TagsGrid,{tags:h(),allPosts:a,localization:{sortBy:((L=(y=o.settings.localization)==null?void 0:y.tagsIndex)==null?void 0:L.sortBy)||"Sort by",noOfPosts:((M=(S=o.settings.localization)==null?void 0:S.tagsIndex)==null?void 0:M.noOfPosts)||`No. of ${l.plural}`,titleAtoZ:((I=(D=o.settings.localization)==null?void 0:D.tagsIndex)==null?void 0:I.titleAtoZ)||"Title (A-Z)",titleZtoA:((U=(F=o.settings.localization)==null?void 0:F.tagsIndex)==null?void 0:U.titleZtoA)||"Title (Z-A)",featuredPosts:((B=(G=o.settings.localization)==null?void 0:G.blogIndex)==null?void 0:B.featuredPosts)||`Featured ${l.plural}`},ALPHABETICAL:xe,REVERSE_ALPHABETICAL:ye,formAction:`/${p.generatedPages}${se({title:i.plural})}`,defaultSortByValue:g,sortByOnChange:N=>{d(N.currentTarget.form)},tagsDatabaseName:i,contentDatabaseName:l,contentIndexPageLink:Z({publication:o,urlPrefixes:p})})]})}var me=v(w());function Je(){var h,s,r,c,u,P,_,m,b,y,L,S,M,D;let{posts:e,authors:a,publication:t}=W(),o=_e(),{content:d,authors:l}=V({publication:t}),i=Ne(),[n]=pe(),g=n.get("sortBy"),p=H({publication:t});function f(){return a.sort((I,F)=>{if(g===d.plural){let N=we({author:I,allPosts:e}).length,z=we({author:F,allPosts:e}).length;if(N!==z)return z-N}let U=I.title.toLocaleLowerCase(),G=F.title.toLocaleLowerCase(),B=g===xe?1:g===ye?-1:0;return(U<G?-1:U>G?1:0)*B})}return(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(p.AuthorsTitle,{authorsDatabaseName:l,localization:{findAllTheAuthors:((s=(h=t.settings.localization)==null?void 0:h.authorsIndex)==null?void 0:s.findAllTheAuthors)||`Find all the ${l.plural}`,authorsDescription:((c=(r=t.settings.localization)==null?void 0:r.authorsIndex)==null?void 0:c.authorsDescription)||((P=(u=t.databases.authors)==null?void 0:u.page)==null?void 0:P.description)||""},authorsIndexPageLink:`/${i.generatedPages}${se({title:l.plural})}`,contentIndexPageLink:Z({publication:t,urlPrefixes:i})}),(0,me.jsx)(p.AuthorsGrid,{authors:f(),allPosts:e,localization:{sortBy:((m=(_=t.settings.localization)==null?void 0:_.tagsIndex)==null?void 0:m.sortBy)||"Sort by",noOfPosts:((y=(b=t.settings.localization)==null?void 0:b.tagsIndex)==null?void 0:y.noOfPosts)||`No. of ${d.plural}`,nameAtoZ:((S=(L=t.settings.localization)==null?void 0:L.authorsIndex)==null?void 0:S.nameAtoZ)||"Name (A-Z)",nameZtoA:((D=(M=t.settings.localization)==null?void 0:M.authorsIndex)==null?void 0:D.nameZtoA)||"Name (Z-A)"},ALPHABETICAL:xe,REVERSE_ALPHABETICAL:ye,formAction:`/${i.generatedPages}${se({title:l.plural})}`,defaultSortByValue:g,sortByOnChange:I=>{o(I.currentTarget.form)},contentDatabaseName:d})]})}var Xe=v(ve());var T=v(w());function Ke({posts:e,allTags:a,allAuthors:t,localization:o}){return(0,T.jsx)("section",{className:"featured-articles-list bg-secondary-50 py-12 sm:py-16 lg:py-20",children:(0,T.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,T.jsx)("h2",{className:"text-xl font-bold text-secondary-900 sm:text-2xl",children:o.featuredPosts}),(0,T.jsx)(mt,{posts:e,allTags:a,allAuthors:t})]})})}function mt({posts:e,allTags:a,allAuthors:t}){return(0,T.jsx)("div",{className:"featured-articles-wrapper grid grid-cols-2 gap-x-16 mt-8",children:e.slice(0,2).map(o=>(0,T.jsx)(pt,{post:o,allAuthors:t,allTags:a},o.id))})}function pt({post:e,allAuthors:a,allTags:t}){return(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)("div",{className:"featured-article",children:[(0,T.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,T.jsx)("p",{className:"text-base font-bold text-secondary-900",children:(0,T.jsx)("time",{dateTime:e.publish_date,children:Se(e.publish_date)})}),he({post:e,allAuthors:a}).slice(0,1).map(o=>(0,T.jsxs)(Xe.Fragment,{children:[(0,T.jsx)("span",{className:"text-sm text-secondary-400",children:"/"}),(0,T.jsx)("div",{className:"flex items-center space-x-3",children:(0,T.jsxs)("div",{className:"relative flex items-center",children:[o.photo&&(0,T.jsx)(Le,{className:"h-6 w-6 shrink-0 rounded-full",src:o.photo,alt:o.title}),(0,T.jsx)("p",{className:"flex-1 text-sm font-semibold text-secondary-900 ml-2",children:(0,T.jsxs)(oe,{href:o.derivedHref,children:[o.title,(0,T.jsx)("span",{className:"absolute inset-0","aria-hidden":"true"})]})})]})})]},o.id))]}),(0,T.jsx)("p",{className:"text-xl font-bold text-secondary-900 mt-4 group-hover:text-opacity-70",children:(0,T.jsx)(oe,{href:e.derivedHref,className:"",children:e.title})}),e.excerpt&&(0,T.jsx)("p",{className:"text-base font-medium leading-7 text-secondary-500 mt-4",children:e.excerpt}),re({post:e,allTags:t}).length>0&&(0,T.jsx)("div",{className:"flex flex-wrap mt-4 space-x-2",children:re({post:e,allTags:t}).map(o=>(0,T.jsx)(oe,{href:o.derivedHref,className:"inline-flex items-center bg-secondary-100 text-xs font-bold text-secondary-500 transition-all duration-200 rounded-full px-2.5 py-0.5 hover:bg-secondary-200 hover:text-secondary-900",children:o.title},o.id))}),(0,T.jsx)("div",{className:"mt-6",children:(0,T.jsxs)(oe,{href:e.derivedHref,className:"inline-flex items-center text-xs font-bold uppercase tracking-widest text-secondary-500 transition-all duration-200 focus:outline-none group-hover:text-secondary-900",children:["Read more",(0,T.jsx)("svg",{className:"h-4 w-4 transform transition-all duration-100 ml-2 group-hover:translate-x-1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,T.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})})]})})}var x=v(w());function Ye({allPosts:e,allTags:a,allAuthors:t,removePaddingTop:o,contentDatabaseName:d,tagsDatabaseName:l,showCategoryFilters:i,selectedTagSlugs:n,totalPages:g,currentPageNumber:p,posts:f,cumulativePosts:h,paginationFormActionPath:s,categoryFiltersFormActionPath:r,localization:c,showPagination:u}){return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(We,{allPosts:e,allTags:a,allAuthors:t,contentDatabaseName:d,tagsDatabaseName:l,showCategoryFilters:i,selectedTagSlugs:n,totalPages:g,currentPageNumber:p,posts:f,cumulativePosts:h,paginationFormActionPath:s,categoryFiltersFormActionPath:r,removePaddingTop:o,localization:c,showPagination:u,children:(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"flow-root",children:(0,x.jsx)("div",{className:"divide-secondary-200 -my-12 divide-y",children:f.map(P=>(0,x.jsx)(ft,{post:P,allAuthors:t,allTags:a},P.id))})})})})})}function ft({post:e,allAuthors:a,allTags:t}){return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{className:"normal-article py-8 sm:flex sm:items-start sm:py-12",children:[(0,x.jsxs)("div",{className:"shrink-0 sm:w-40 lg:w-48",children:[(0,x.jsx)("p",{className:"article-publish-date text-base font-bold text-secondary-900",children:(0,x.jsx)("time",{dateTime:e.publish_date,children:Se(e.publish_date)})}),he({post:e,allAuthors:a}).map(o=>(0,x.jsxs)("div",{className:"article-author relative flex items-center mt-3",children:[o.photo&&(0,x.jsx)(Le,{className:"h-6 w-6 shrink-0 mr-2 rounded-full",src:o.photo,alt:o.title}),(0,x.jsx)("p",{className:"flex-1 text-sm font-semibold text-secondary-900",children:(0,x.jsxs)(oe,{href:o.derivedHref,children:[o.title,(0,x.jsx)("span",{className:"absolute inset-0","aria-hidden":"true"})]})})]},o.id))]}),(0,x.jsxs)("div",{className:"group relative min-w-0 flex-1 mt-5 sm:mt-0 sm:ml-12",children:[(0,x.jsx)("h3",{className:"article-title text-xl font-bold text-secondary-900 group-hover:text-opacity-70",children:(0,x.jsx)(oe,{href:e.derivedHref,className:"",children:e.title})}),e.excerpt&&(0,x.jsx)("p",{className:"article-excerpt text-base font-medium leading-7 text-secondary-500 mt-4",children:e.excerpt}),re({post:e,allTags:t}).length>0&&(0,x.jsx)("div",{className:"article-tags-list flex flex-wrap mt-4",children:re({post:e,allTags:t}).map(o=>(0,x.jsx)(oe,{href:o.derivedHref,className:"article-tag inline-flex items-center bg-secondary-100 text-xs font-bold text-secondary-500 transition-all duration-200 mr-2 mb-2 rounded-full px-2.5 py-0.5 hover:bg-secondary-200 hover:text-secondary-900",children:o.slug},o.id))}),(0,x.jsx)("div",{className:"mt-6",children:(0,x.jsxs)(oe,{href:e.derivedHref,className:"inline-flex items-center text-xs font-bold uppercase tracking-widest text-secondary-500 transition-all duration-200 focus:outline-none group-hover:text-secondary-900",children:["Read more",(0,x.jsx)("svg",{className:"h-4 w-4 transform transition-all duration-100 ml-2 group-hover:translate-x-1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,x.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})})]})]})})}var Y=v(w());function Pe(e){var g,p,f,h;let{currentPageFeaturedPosts:a,layout:t,allAuthors:o,allTags:d,publication:l,databaseNames:i,Template:n}=je(e);return(0,Y.jsx)(Y.Fragment,{children:a.length>0&&(0,Y.jsx)(Y.Fragment,{children:(!l.settings.template||l.settings.template==="NORMAL")&&t==="TEXT_ONLY"?(0,Y.jsx)(Ke,{posts:a,allAuthors:o,allTags:d,localization:{featuredPosts:((p=(g=l.settings.localization)==null?void 0:g.blogIndex)==null?void 0:p.featuredPosts)||`Featured ${i.content.plural}`},removePaddingTop:e.removePaddingTop}):(0,Y.jsx)(n.FeaturedPosts,{posts:a,allAuthors:o,allTags:d,localization:{featuredPosts:((h=(f=l.settings.localization)==null?void 0:f.blogIndex)==null?void 0:h.featuredPosts)||`Featured ${i.content.plural}`},removePaddingTop:e.removePaddingTop})})})}function Te(e){var u,P,_,m,b,y,L,S,M,D,I,F,U,G,B,N,z,X,j,ee,q,Q,ce,ge,ue,E,R,$,k,C,K,te;let{allPosts:a,allTags:t,layout:o,allAuthors:d,databaseNames:l,publication:i,selectedTagSlugs:n,totalPages:g,currentPageNumber:p,currentPagePosts:f,currentPageCumulativePosts:h,location:s,paginationFormActionPathSearch:r,Template:c}=je(e);return(0,Y.jsx)(Y.Fragment,{children:(!i.settings.template||i.settings.template==="NORMAL")&&o==="TEXT_ONLY"?(0,Y.jsx)(Ye,{allPosts:a,allTags:t,allAuthors:d,removePaddingTop:e.removePaddingTop,contentDatabaseName:l.content,tagsDatabaseName:l.tags,showCategoryFilters:!!((u=i.settings.features)!=null&&u.categoryFilters),selectedTagSlugs:n,totalPages:g,currentPageNumber:p,posts:f,cumulativePosts:h,categoryFiltersFormActionPath:`${s.pathname}?page=${p}`,paginationFormActionPath:`${s.pathname}${r}`,localization:{allPosts:((_=(P=i.settings.localization)==null?void 0:P.blogIndex)==null?void 0:_.allPosts)||`All ${l.content.plural}`,allTags:((b=(m=i.settings.localization)==null?void 0:m.blogIndex)==null?void 0:b.allTags)||`All ${fe(l.tags.plural)}`,viewTags:((L=(y=i.settings.localization)==null?void 0:y.blogIndex)==null?void 0:L.viewTags)||`View ${fe(l.tags.plural)}`,previous:((M=(S=i.settings.localization)==null?void 0:S.blogIndex)==null?void 0:M.previous)||"Previous",next:((I=(D=i.settings.localization)==null?void 0:D.blogIndex)==null?void 0:I.next)||"Next",no_articles_found_here:((U=(F=i.settings.localization)==null?void 0:F.blogIndex)==null?void 0:U.no_articles_found_here)||`No ${l.content.plural} found in this page! Try other pages.`,loadMore:((B=(G=i.settings.localization)==null?void 0:G.blogIndex)==null?void 0:B.loadMore)||"Load More"},showPagination:!!((N=i.settings.features)!=null&&N.pagination)}):(0,Y.jsx)(c.NormalPosts,{allPosts:a,allTags:t,allAuthors:d,removePaddingTop:e.removePaddingTop,contentDatabaseName:l.content,tagsDatabaseName:l.tags,showCategoryFilters:!!((z=i.settings.features)!=null&&z.categoryFilters),selectedTagSlugs:n,totalPages:g,currentPageNumber:p,posts:f,cumulativePosts:h,categoryFiltersFormActionPath:`${s.pathname}?page=${p}`,paginationFormActionPath:`${s.pathname}${r}`,localization:{allPosts:((j=(X=i.settings.localization)==null?void 0:X.blogIndex)==null?void 0:j.allPosts)||`All ${l.content.plural}`,allTags:((q=(ee=i.settings.localization)==null?void 0:ee.blogIndex)==null?void 0:q.allTags)||`All ${fe(l.tags.plural)}`,viewTags:((ce=(Q=i.settings.localization)==null?void 0:Q.blogIndex)==null?void 0:ce.viewTags)||`View ${fe(l.tags.plural)}`,previous:((ue=(ge=i.settings.localization)==null?void 0:ge.blogIndex)==null?void 0:ue.previous)||"Previous",next:((R=(E=i.settings.localization)==null?void 0:E.blogIndex)==null?void 0:R.next)||"Next",no_articles_found_here:((k=($=i.settings.localization)==null?void 0:$.blogIndex)==null?void 0:k.no_articles_found_here)||`No ${l.content.plural} found in this page! Try other pages.`,loadMore:((K=(C=i.settings.localization)==null?void 0:C.blogIndex)==null?void 0:K.loadMore)||"Load More"},showPagination:!!((te=i.settings.features)!=null&&te.pagination)})})}function je({filterPosts:e,excludedTags:a}){var M,D,I,F,U,G,B;let{publication:t,posts:o,tags:d,authors:l}=W(),i=(M=t.settings.layout)!=null?M:"GRID",n=e({posts:o}),g=V({publication:t}),[p]=pe(),f=g.tags.singular,h=Number(p.get("page")||"1"),s=p.getAll(f).map(N=>decodeURIComponent(N)),r=Be({tagsDatabaseName:g.tags,localization:{allTags:((I=(D=t.settings.localization)==null?void 0:D.blogIndex)==null?void 0:I.allTags)||`All ${fe(g.tags.plural)}`}});s.length===0&&(s=[r.slug]);let c=n.filter(N=>s.includes(r.slug)?!0:s.every(z=>re({post:N,allTags:d}).map(X=>X.slug).includes(z))),u=(U=(F=t.settings.features)==null?void 0:F.pageSize)!=null?U:6,P=u>0?Math.ceil(c.length/u):0,_=(G=t.settings.features)!=null&&G.pagination?c.slice((h-1)*u,h*u):c,m=(B=t.settings.features)!=null&&B.pagination?c.slice(0,h*u):c,b=n.filter(N=>N.featured),y=ke(),L=s.length>0?`?${f}=${s.join(`&${f}=`)}`:"",S=H({publication:t});return{currentPageFeaturedPosts:b,layout:i,allAuthors:l,allTags:d.filter(N=>!a.some(z=>z.id===N.id)).filter(N=>be({tag:N,allPosts:n}).length>0),publication:t,databaseNames:g,allPosts:n,selectedTagSlugs:s,totalPages:P,currentPageNumber:h,currentPagePosts:_,currentPageCumulativePosts:m,location:y,paginationFormActionPathSearch:L,Template:S}}var ie=v(w());function qe({currentAuthor:e,children:a}){var g;let{authors:t,publication:o}=W(),d=V({publication:o}),l=ne({publication:o}),i=H({publication:o}),n=({posts:p})=>p.filter(f=>he({post:f,allAuthors:t}).map(h=>h.id).includes(e.id));return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(i.AuthorTitle,{author:e,authorsDatabaseName:d.authors,authorsIndexPageLink:`/${l.generatedPages}${se({title:d.authors.plural})}`,contentIndexPageLink:Z({publication:o,urlPrefixes:l})}),a,((g=o.settings.features)==null?void 0:g.featuredPostsInAuthorPage)&&(0,ie.jsx)(i.HeroWrapper,{removePadding:!0,children:(0,ie.jsx)(Pe,{filterPosts:n,removePaddingTop:!1,excludedTags:[]})}),(0,ie.jsx)(Te,{filterPosts:n,removePaddingTop:!1,excludedTags:[]})]})}function Ce(){var a;let e=Fe("root");return(a=e==null?void 0:e.magicLinkSent)!=null?a:!1}var J=v(w()),Qe=({posts:e})=>e.filter(a=>!a.hide_in_main_feed);function et({heroPageRecordMap:e,isFullPageHero:a}){var p,f,h,s,r,c,u,P,_,m,b,y,L,S,M,D;let{publication:t,tags:o,posts:d}=W(),l=H({publication:t}),i=Ce(),n=o.filter(I=>I.featured),g=Ze({template:t.settings.template,customTemplate:t.settings.customTemplate});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(l.HeroWrapper,{removePadding:!1,children:[(0,J.jsx)(l.Hero,{heading:t.settings.blogIndexTitle||t.settings.metaTitle||"",subHeading:t.settings.blogIndexDescription||t.settings.metaDescription||""}),((p=t.settings.features)==null?void 0:p.newsletterInHero)&&(0,J.jsx)(Ge,{newsletterSectionId:"newsletter-in-header-wrapper",className:"newsletter-in-header bg-white",id:"hero-email",heading:((f=t.settings.cta)==null?void 0:f.headlineInHeader)||"",subHeading:((h=t.settings.cta)==null?void 0:h.textInHeader)||"",magicLinkSent:i,formAction:"/_feather/subscribe",publicationId:t.id,formInput:{defaultValue:"",placeholder:((r=(s=t.settings.localization)==null?void 0:s.newsletter)==null?void 0:r.placeholder)||"Enter your email address",name:"email",ariaLabel:"Email"},submitButton:{localization:{subscribing:"Subscribing...",logout:"Logout",subscribe:((u=(c=t.settings.localization)==null?void 0:c.newsletter)==null?void 0:u.subscribe)||((P=t.settings.cta)==null?void 0:P.ctaButtonTextInHeader)||"Subscribe to newsletter"}},submitButtonValue:"subscribe",submitButtonName:"_action",disclaimer:(m=(_=t.settings.cta)==null?void 0:_.disclaimerInHeader)!=null?m:"",toastMessages:{successEmailSent:t.settings.features.newsletterEmailVerification?"Sent the verification email!":"Subscribed!",loggedOut:"Logged out!"},isLoggedIn:!1,newsletter:l.Newsletter}),e&&(0,J.jsx)(J.Fragment,{children:(0,J.jsx)(l.TemplateNotionPage,{recordMap:e,fullPage:a,currentSlug:"HERO_SPECIAL_BLOCK",imageZoom:(y=(b=t.settings.features)==null?void 0:b.imageZoom)!=null?y:!1,interactiveCheckboxes:(S=(L=t.settings.features)==null?void 0:L.interactiveCheckboxes)!=null?S:!1,hideCover:!1,mergeTags:null,className:"hero-special-block"})}),(0,J.jsx)(Pe,{filterPosts:Qe,removePaddingTop:!e,excludedTags:[]})]}),g&&n.length>0&&(0,J.jsx)(l.FeaturedTags,{tags:o.filter(I=>I.featured),allPosts:d,allTags:o,maxPostsInEachFeaturedTag:3,localization:{viewAll:((D=(M=t.settings.localization)==null?void 0:M.blogIndex)==null?void 0:D.viewAll)||"View all"}}),(0,J.jsx)(Te,{filterPosts:Qe,removePaddingTop:g&&n.length===0||t.settings.template==="PRODUCT_UPDATES"||t.settings.template==="HELP_DOCS",excludedTags:[]})]})}var it=v(dt()),Ie=v(at()),Me=v(ve());var $e=v(ve()),rt=v(st()),Ae=v(w());function nt(e){let a=$e.default.useRef(null),t=e.attrs.host||"https://cusdis.com";return(0,rt.useScript)("https://cusdis.feather.so/js/cusdis.es.js"),$e.default.useLayoutEffect(()=>{let d=window.renderCusdis;d&&d(a.current)},[e.attrs.appId,e.attrs.host,e.attrs.pageId,e.attrs.pageTitle,e.attrs.pageUrl,e.lang]),(0,Ae.jsx)(Ae.Fragment,{children:(0,Ae.jsx)("div",{id:"cusdis_thread","data-host":t,"data-page-id":e.attrs.pageId,"data-app-id":e.attrs.appId,"data-page-title":e.attrs.pageTitle,"data-page-url":e.attrs.pageUrl,"data-theme":e.attrs.theme,style:e.style,ref:a})})}var O=v(w());function lt({recordMap:e,currentPost:a,toc:t,relatedPosts:o,currentNotionRecord:d,allTags:l,allAuthors:i}){var c,u,P,_,m,b,y,L,S,M,D,I,F,U,G,B,N,z,X,j,ee,q,Q,ce,ge,ue;let{publication:n}=W(),g=V({publication:n}),p=ne({publication:n}),f=H({publication:n}),h=Ce(),s=Ue(),r={host:"https://cusdis.com",appId:(u=(c=n.settings.features)==null?void 0:c.cusdisId)!=null?u:"",pageId:a.id,pageTitle:a.title,pageUrl:a.canonical};return(0,Me.useEffect)(()=>{var E;(E=n.settings.features)!=null&&E.disqusShortName&&(window.disqus_config=function(){this.page.url=a.canonical,this.page.identifier=a.id},function(){var k;let R=document,$=R.createElement("script");$.src=`https://${(k=n.settings.features)==null?void 0:k.disqusShortName}.disqus.com/embed.js`,$.dataset.timestamp=`${Date.now()}`,(R.head||R.body).append($)}())},[a.canonical,a.id,(P=n.settings.features)==null?void 0:P.disqusShortName]),(0,Me.useEffect)(()=>{let E=(0,it.default)(()=>{let{scrollTop:R,clientHeight:$,scrollHeight:k}=document.documentElement,C=k-$,K=R/C;Ie.default.configure({showSpinner:!1,minimum:0}),Ie.default.set(K)},100);return window.addEventListener("scroll",E),()=>{Ie.default.done(),window.removeEventListener("scroll",E)}},[]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(f.PostTitle,{post:a,allAuthors:i,allTags:l,contentIndexPageLink:Z({publication:n,urlPrefixes:p}),contentDatabaseName:g.content,localization:{publishedOn:((m=(_=n.settings.localization)==null?void 0:_.blogPostContentPage)==null?void 0:m.publishedOn)||"Published on"}}),(0,O.jsx)(f.PostContent,{post:a,allAuthors:i,allTags:l,contentIndexPageLink:Z({publication:n,urlPrefixes:p}),contentDatabaseName:g.content,tagsDatabaseName:g.tags,showSidebar:(y=(b=n.settings.features)==null?void 0:b.postSidebar)!=null?y:!0,toc:t,localization:{publishedOn:((S=(L=n.settings.localization)==null?void 0:L.blogPostContentPage)==null?void 0:S.publishedOn)||"Published on",tableOfContents:((D=(M=n.settings.localization)==null?void 0:M.blogPostContentPage)==null?void 0:D.tableOfContents)||"Table of Contents",writtenBy:((F=(I=n.settings.localization)==null?void 0:I.blogPostContentPage)==null?void 0:F.writtenBy)||"Written by",shareThisArticle:((G=(U=n.settings.localization)==null?void 0:U.blogPostContentPage)==null?void 0:G.shareThisArticle)||`Share this ${g.content.singular}`,urlCopied:((N=(B=n.settings.localization)==null?void 0:B.blogPostContentPage)==null?void 0:N.urlCopied)||"Copied the URL to the clipboard"},recordMap:e,imageZoom:(X=(z=n.settings.features)==null?void 0:z.imageZoom)!=null?X:!1,interactiveCheckboxes:(ee=(j=n.settings.features)==null?void 0:j.interactiveCheckboxes)!=null?ee:!1,notionRecord:d,showCTAButton:!!((q=n.settings.features)!=null&&q.ctaButton),ctaButton:()=>{var E,R,$,k,C,K,te,ae;return(0,O.jsx)(f.CTA,{heading:(R=(E=n.settings.cta)==null?void 0:E.ctaButtonHeading)!=null?R:"",subHeading:(k=($=n.settings.cta)==null?void 0:$.ctaButtonSubHeading)!=null?k:"",buttonLink:(K=(C=n.settings.cta)==null?void 0:C.ctaButtonLink)!=null?K:"",buttonText:(ae=(te=n.settings.cta)==null?void 0:te.ctaButtonText)!=null?ae:""})},isFullNotionPage:!1}),((Q=n.settings.features)==null?void 0:Q.comments)&&r.appId&&(0,O.jsx)("section",{className:"bg-white py-12",children:(0,O.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,O.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,O.jsxs)("div",{className:"space-y-8",children:[(0,O.jsxs)("p",{className:"text-xl font-bold text-secondary-900",children:[(0,O.jsx)("span",{"data-cusdis-count-page-id":r.pageId,children:"0"})," ","comments"]}),(0,O.jsx)("script",{defer:!0,"data-host":"https://cusdis.com","data-app-id":r.appId,src:"https://cusdis.feather.so/js/cusdis-count.umd.js"}),(0,O.jsx)(nt,{attrs:r,style:{width:"100%"}})]})})})}),((ce=n.settings.features)==null?void 0:ce.comments)&&n.settings.features.disqusShortName&&(0,O.jsx)("section",{className:"bg-white py-12",children:(0,O.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,O.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,O.jsx)("div",{className:"space-y-8",children:(0,O.jsx)("div",{id:"disqus_thread"})})})})}),o.length>0&&(0,O.jsx)(f.RelatedPosts,{posts:o,allTags:l,allAuthors:i,localization:{relatedPosts:((ue=(ge=n.settings.localization)==null?void 0:ge.blogPostContentPage)==null?void 0:ue.relatedPosts)||`Related ${g.content.plural}`},contentIndexPageLink:Z({publication:n,urlPrefixes:p}),contentDatabaseName:g.content})]})}var le=v(w());function ct({currentTag:e,children:a}){var g;let{tags:t,publication:o}=W(),d=V({publication:o}),l=ne({publication:o}),i=H({publication:o}),n=({posts:p})=>p.filter(f=>re({post:f,allTags:t}).map(h=>h.id).includes(e.id));return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(i.TagTitle,{tag:e,tagsDatabaseName:d.tags,tagsIndexPageLink:`/${l.generatedPages}${se({title:d.tags.plural})}`,contentIndexPageLink:Z({publication:o,urlPrefixes:l})}),a,((g=o.settings.features)==null?void 0:g.featuredPostsInTagPage)&&(0,le.jsx)(i.HeroWrapper,{removePadding:!0,children:(0,le.jsx)(Pe,{filterPosts:n,removePaddingTop:!1,excludedTags:[e]})}),(0,le.jsx)(Te,{filterPosts:n,removePaddingTop:!1,excludedTags:[e]})]})}var A=v(w());var Ka=({data:e,parentsData:a})=>{var f,h,s,r;let t=e,o=(t==null?void 0:t.routeType)==="POST"?t==null?void 0:t.currentPost:(t==null?void 0:t.routeType)==="PAGE"||(t==null?void 0:t.routeType)==="CUSTOM_HOME_PAGE"||(t==null?void 0:t.routeType)==="ALL_ARTICLES_PAGE"?t==null?void 0:t.currentPage:(t==null?void 0:t.routeType)==="TAG"?t==null?void 0:t.currentTag:(t==null?void 0:t.routeType)==="AUTHOR"?t==null?void 0:t.currentAuthor:(t==null?void 0:t.routeType)==="INTERNAL_PAGE"?t==null?void 0:t.currentInternalPage:{meta_title:"",meta_description:"",cover:"",og_image:""},d=Re({text:o==null?void 0:o.meta_title}),l=o==null?void 0:o.cover,i=o==null?void 0:o.og_image,n=Re({text:o==null?void 0:o.meta_description}),g=((f=a==null?void 0:a.root)==null?void 0:f.indexing)&&((t==null?void 0:t.routeType)==="POST"?!(t!=null&&t.currentPost.do_not_index):(t==null?void 0:t.routeType)==="PAGE"?!(t!=null&&t.currentPage.do_not_index):(t==null?void 0:t.routeType)==="TAG"?!(t!=null&&t.currentTag.do_not_index):(t==null?void 0:t.routeType)==="AUTHOR"?!(t!=null&&t.currentAuthor.do_not_index):!0),p=(r=(s=(h=t==null?void 0:t.publication)==null?void 0:h.settings)==null?void 0:s.features)!=null&&r.autoGenerateCovers?i||l||(t==null?void 0:t.og_image)||"":i||l||"";return{...d?{title:d,"og:title":d}:{},...n?{description:n,"og:description":n}:{},"og:url":t==null?void 0:t.canonical,"og:image":p,"og:image:alt":d,robots:g?"index,follow":"noindex"}},Pt=({data:e})=>[{rel:"canonical",href:e==null?void 0:e.canonical}];function Tt(){var i,n,g,p,f,h,s,r,c,u,P,_,m,b,y,L,S,M,D,I,F,U,G,B,N,z,X,j,ee,q,Q,ce,ge,ue;let e=ze(),{publication:a,tags:t,authors:o}=W(),{isSearchOpen:d,setIsSearchOpen:l}=He();if(e.routeType==="ALL_ARTICLES_PAGE")return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(et,{heroPageRecordMap:e.heroPageRecordMap,isFullPageHero:e.isFullPageHero})});if(e.routeType==="POST"){let{currentPost:E,relatedPosts:R,toc:$,recordMap:k,canonical:C,currentNotionRecord:K}=e;return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(lt,{currentPost:{...E,canonical:C},toc:$,relatedPosts:R,recordMap:k,currentNotionRecord:K,allTags:t,allAuthors:o})})}if(e.routeType==="PAGE"||e.routeType==="CUSTOM_HOME_PAGE"){let{currentPage:E,toc:R,canonical:$,recordMap:k,currentNotionRecord:C}=e,K=H({publication:a}),te=ne({publication:a}),ae=V({publication:a});return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(K.PostContent,{post:{...E,publish_date:E.last_edited_time,canonical:$,authors:[],tags:[],page_icon:typeof((i=C==null?void 0:C.page_icon)==null?void 0:i.value)=="string"?C.page_icon.value:""},allAuthors:o,allTags:t,contentIndexPageLink:Z({publication:a,urlPrefixes:te}),contentDatabaseName:ae.content,tagsDatabaseName:ae.tags,showSidebar:(g=(n=a.settings.features)==null?void 0:n.pagesSidebar)!=null?g:!1,toc:R,localization:{publishedOn:((f=(p=a.settings.localization)==null?void 0:p.blogPostContentPage)==null?void 0:f.publishedOn)||"Published on",tableOfContents:((s=(h=a.settings.localization)==null?void 0:h.blogPostContentPage)==null?void 0:s.tableOfContents)||"Table of Contents",writtenBy:((c=(r=a.settings.localization)==null?void 0:r.blogPostContentPage)==null?void 0:c.writtenBy)||"Written by",shareThisArticle:((P=(u=a.settings.localization)==null?void 0:u.blogPostContentPage)==null?void 0:P.shareThisArticle)||`Share this ${ae.content.singular}`,urlCopied:((m=(_=a.settings.localization)==null?void 0:_.blogPostContentPage)==null?void 0:m.urlCopied)||"Copied the URL to the clipboard"},recordMap:k,imageZoom:(y=(b=a.settings.features)==null?void 0:b.imageZoom)!=null?y:!1,interactiveCheckboxes:(S=(L=a.settings.features)==null?void 0:L.interactiveCheckboxes)!=null?S:!1,notionRecord:C,showCTAButton:!1,ctaButton:()=>(0,A.jsx)(A.Fragment,{}),isFullNotionPage:!0})})}if(e.routeType==="INTERNAL_PAGE"){let{currentInternalPage:E,toc:R,canonical:$,recordMap:k,currentNotionRecord:C}=e,K=H({publication:a}),te=ne({publication:a}),ae=V({publication:a});return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(K.PostContent,{post:{title:E.title,canonical:$,slug:E.slug,authors:[],cover:"",excerpt:"",derivedHref:`/${te.internalPages}${E.slug}`,publish_date:new Date().toISOString(),tags:[],page_icon:typeof((M=C==null?void 0:C.page_icon)==null?void 0:M.value)=="string"?C.page_icon.value:"",hide_cover:!0},allAuthors:o,allTags:t,contentIndexPageLink:Z({publication:a,urlPrefixes:te}),contentDatabaseName:ae.content,tagsDatabaseName:ae.tags,showSidebar:(I=(D=a.settings.features)==null?void 0:D.internalPageSidebar)!=null?I:!1,toc:R,localization:{publishedOn:((U=(F=a.settings.localization)==null?void 0:F.blogPostContentPage)==null?void 0:U.publishedOn)||"Published on",tableOfContents:((B=(G=a.settings.localization)==null?void 0:G.blogPostContentPage)==null?void 0:B.tableOfContents)||"Table of Contents",writtenBy:((z=(N=a.settings.localization)==null?void 0:N.blogPostContentPage)==null?void 0:z.writtenBy)||"Written by",shareThisArticle:((j=(X=a.settings.localization)==null?void 0:X.blogPostContentPage)==null?void 0:j.shareThisArticle)||`Share this ${ae.content.singular}`,urlCopied:((q=(ee=a.settings.localization)==null?void 0:ee.blogPostContentPage)==null?void 0:q.urlCopied)||"Copied the URL to the clipboard"},recordMap:k,imageZoom:(ce=(Q=a.settings.features)==null?void 0:Q.imageZoom)!=null?ce:!1,interactiveCheckboxes:(ue=(ge=a.settings.features)==null?void 0:ge.interactiveCheckboxes)!=null?ue:!1,notionRecord:C,showCTAButton:!1,isFullNotionPage:!0,ctaButton:()=>(0,A.jsx)(A.Fragment,{})})})}if(e.routeType==="TAG"){let{recordMap:E,currentTag:R,canonical:$,currentNotionRecord:k}=e,C=H({publication:a});return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(ct,{currentTag:{...R,canonical:$},children:(0,A.jsx)(C.TagsPostContentWrapper,{recordMap:E,publication:a,currentNotionRecord:k,currentSlug:R.slug})})})}if(e.routeType==="AUTHOR"){let{recordMap:E,currentAuthor:R,canonical:$,currentNotionRecord:k}=e,C=H({publication:a});return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(qe,{currentAuthor:{...R,canonical:$},children:(0,A.jsx)(C.TagsPostContentWrapper,{recordMap:E,publication:a,currentNotionRecord:k,currentSlug:R.slug})})})}return e.routeType==="ALL_TAGS"?(0,A.jsx)(Ve,{openSearch:()=>{l(!0)}}):e.routeType==="ALL_AUTHORS"?(0,A.jsx)(Je,{}):(0,A.jsx)(A.Fragment,{})}var bt=e=>{try{return(e==null?void 0:e.routeType)==="POST"?e.structuredData:[]}catch(a){return console.error({error:a}),[]}},Ya={dynamicLinks:Pt,structuredData:bt};export{Ka as a,Tt as b,Ya as c};
