text: import{S as s,i as t,s as a,e,w as r,f as l,h as n,x as c,k as i,u as o,l as d,y as h,t as f,b as u,B as p,p as m,d as g,r as v,j as E,m as I,o as x,D as $,E as b,L as D}from"./index.d504ffde.js";import{a as w}from"./app.8d939e64.js";import{b as y,d as V}from"./_api.b86b90d5.js";import{s as j}from"./showdown.20a62d9b.js";import{T as _}from"./Tags.67e5a0f9.js";function N(s){let t,a;const m=new _({props:{tags:s[0].tags}});return{c(){t=e("div"),r(m.$$.fragment),this.h()},l(s){t=l(s,"DIV",{class:!0});var a=n(t);c(m.$$.fragment,a),a.forEach(i),this.h()},h(){o(t,"class","post-tags")},m(s,e){d(s,t,e),h(m,t,null),a=!0},p(s,t){const a={};1&t&&(a.tags=s[0].tags),m.$set(a)},i(s){a||(f(m.$$.fragment,s),a=!0)},o(s){u(m.$$.fragment,s),a=!1},d(s){s&&i(t),p(m)}}}function T(s){let t,a,r,c,h,f,u,p,$,b,D,w=s[0].prev.title+"";return{c(){t=e("a"),a=e("div"),r=e("i"),c=m(),h=e("div"),f=e("strong"),u=g("Previous Post"),p=m(),$=e("h6"),b=g(w),this.h()},l(s){t=l(s,"A",{href:!0,class:!0});var e=n(t);a=l(e,"DIV",{class:!0});var o=n(a);r=l(o,"I",{class:!0}),n(r).forEach(i),o.forEach(i),c=v(e),h=l(e,"DIV",{class:!0});var d=n(h);f=l(d,"STRONG",{class:!0});var m=n(f);u=E(m,"Previous Post"),m.forEach(i),p=v(d),$=l(d,"H6",{});var g=n($);b=E(g,w),g.forEach(i),d.forEach(i),e.forEach(i),this.h()},h(){o(r,"class","fa fa-angle-left"),o(a,"class","icon prev"),o(f,"class","text-primary"),o(h,"class","text"),o(t,"href",D=s[1]+"/posts/"+s[0].prev.slug),o(t,"class","prev-post text-left d-flex align-items-center")},m(s,e){d(s,t,e),I(t,a),I(a,r),I(t,c),I(t,h),I(h,f),I(f,u),I(h,p),I(h,$),I($,b)},p(s,a){1&a&&w!==(w=s[0].prev.title+"")&&x(b,w),3&a&&D!==(D=s[1]+"/posts/"+s[0].prev.slug)&&o(t,"href",D)},d(s){s&&i(t)}}}function q(s){let t,a,r,c,h,f,u,p,$,b,D,w=s[0].next.title+"";return{c(){t=e("a"),a=e("div"),r=e("strong"),c=g("Next Post"),h=m(),f=e("h6"),u=g(w),p=m(),$=e("div"),b=e("i"),this.h()},l(s){t=l(s,"A",{href:!0,class:!0});var e=n(t);a=l(e,"DIV",{class:!0});var o=n(a);r=l(o,"STRONG",{class:!0});var d=n(r);c=E(d,"Next Post"),d.forEach(i),h=v(o),f=l(o,"H6",{});var m=n(f);u=E(m,w),m.forEach(i),o.forEach(i),p=v(e),$=l(e,"DIV",{class:!0});var g=n($);b=l(g,"I",{class:!0}),n(b).forEach(i),g.forEach(i),e.forEach(i),this.h()},h(){o(r,"class","text-primary"),o(a,"class","text"),o(b,"class","fa fa-angle-right"),o($,"class","icon next"),o(t,"href",D=s[1]+"/posts/"+s[0].next.slug),o(t,"class","next-post text-right d-flex align-items-center\n              justify-content-end")},m(s,e){d(s,t,e),I(t,a),I(a,r),I(r,c),I(a,h),I(a,f),I(f,u),I(t,p),I(t,$),I($,b)},p(s,a){1&a&&w!==(w=s[0].next.title+"")&&x(u,w),3&a&&D!==(D=s[1]+"/posts/"+s[0].next.slug)&&o(t,"href",D)},d(s){s&&i(t)}}}function P(s){let t,a,r,c,h,f,u,p;return{c(){t=e("div"),a=m(),r=e("script"),c=g('// configure discuss\n      var disqus_config = function() {\n        this.page.url = location.href;\n        this.page.identifier = location.pathname; // Replace PAGE_IDENTIFIER with your page\'s unique identifier variable\n      };\n\n      (function() {\n        // DON\'T EDIT BELOW THIS LINE\n        var d = document,\n          s = d.createElement("script");\n        s.src = "https://threefoldblog.disqus.com/embed.js";\n        s.setAttribute("data-timestamp", +new Date());\n        (d.head || d.body).appendChild(s);\n      })();'),h=m(),f=m(),u=e("script"),this.h()},l(s){t=l(s,"DIV",{id:!0}),n(t).forEach(i),a=v(s),r=l(s,"SCRIPT",{});var e=n(r);c=E(e,'// configure discuss\n      var disqus_config = function() {\n        this.page.url = location.href;\n        this.page.identifier = location.pathname; // Replace PAGE_IDENTIFIER with your page\'s unique identifier variable\n      };\n\n      (function() {\n        // DON\'T EDIT BELOW THIS LINE\n        var d = document,\n          s = d.createElement("script");\n        s.src = "https://threefoldblog.disqus.com/embed.js";\n        s.setAttribute("data-timestamp", +new Date());\n        (d.head || d.body).appendChild(s);\n      })();'),e.forEach(i),h=v(s),f=v(s),u=l(s,"SCRIPT",{id:!0,src:!0,async:!0}),n(u).forEach(i),this.h()},h(){o(t,"id","disqus_thread"),o(u,"id","dsq-count-scr"),u.src!==(p="//threefoldblog.disqus.com/count.js")&&o(u,"src","//threefoldblog.disqus.com/count.js"),u.async=!0},m(s,e){d(s,t,e),d(s,a,e),d(s,r,e),I(r,c),d(s,h,e),d(s,f,e),d(s,u,e)},d(s){s&&i(t),s&&i(a),s&&i(r),s&&i(h),s&&i(f),s&&i(u)}}}function S(s){let t,a,D,w,y,V,j,S,A,O,R,H,L,G,C,M,k,W,B,F,J,K,z,Q,U,X,Y,Z,ss,ts,as,es,rs,ls,ns,cs,is,os,ds,hs=s[0].title+"",fs=s[0].author_name+"",us=s[0].published_at+"";const ps=new _({props:{tags:s[0].tags}});let ms=s[0].tags&&N(s),gs=void 0!==s[0].prev.slug&&T(s),vs=void 0!==s[0].next.slug&&q(s),Es=s[2].allow_disqus&&P();return{c(){t=e("main"),a=e("div"),D=e("div"),w=e("div"),y=e("img"),j=m(),S=e("div"),A=e("div"),O=e("div"),r(ps.$$.fragment),R=m(),H=e("h1"),L=g(hs),G=m(),C=e("div"),M=e("a"),k=e("div"),W=e("img"),F=m(),J=e("div"),K=e("span"),z=g(fs),U=m(),X=e("div"),Y=e("div"),Z=e("i"),ss=m(),ts=g(us),as=m(),es=e("div"),rs=e("p"),ls=m(),ms&&ms.c(),ns=m(),cs=e("div"),gs&&gs.c(),is=m(),vs&&vs.c(),os=m(),Es&&Es.c(),this.h()},l(s){t=l(s,"MAIN",{class:!0});var e=n(t);a=l(e,"DIV",{class:!0});var r=n(a);D=l(r,"DIV",{class:!0});var o=n(D);w=l(o,"DIV",{class:!0});var d=n(w);y=l(d,"IMG",{src:!0,alt:!0,class:!0}),d.forEach(i),j=v(o),S=l(o,"DIV",{class:!0});var h=n(S);A=l(h,"DIV",{class:!0});var f=n(A);O=l(f,"DIV",{class:!0});var u=n(O);c(ps.$$.fragment,u),u.forEach(i),f.forEach(i),R=v(h),H=l(h,"H1",{});var p=n(H);L=E(p,hs),p.forEach(i),G=v(h),C=l(h,"DIV",{class:!0});var m=n(C);M=l(m,"A",{href:!0,class:!0});var g=n(M);k=l(g,"DIV",{class:!0});var I=n(k);W=l(I,"IMG",{src:!0,onerror:!0,alt:!0,class:!0}),I.forEach(i),F=v(g),J=l(g,"DIV",{class:!0});var x=n(J);K=l(x,"SPAN",{});var $=n(K);z=E($,fs),$.forEach(i),x.forEach(i),g.forEach(i),U=v(m),X=l(m,"DIV",{class:!0});var b=n(X);Y=l(b,"DIV",{class:!0});var V=n(Y);Z=l(V,"I",{class:!0}),n(Z).forEach(i),ss=v(V),ts=E(V,us),V.forEach(i),b.forEach(i),m.forEach(i),as=v(h),es=l(h,"DIV",{class:!0});var _=n(es);rs=l(_,"P",{}),n(rs).forEach(i),_.forEach(i),ls=v(h),ms&&ms.l(h),ns=v(h),cs=l(h,"DIV",{class:!0});var N=n(cs);gs&&gs.l(N),is=v(N),vs&&vs.l(N),N.forEach(i),h.forEach(i),o.forEach(i),r.forEach(i),os=v(e),Es&&Es.l(e),e.forEach(i),this.h()},h(){y.src!==(V=s[3])&&o(y,"src",V),o(y,"alt","..."),o(y,"class","img-fluid"),o(w,"class","post-thumbnail"),o(O,"class","category"),o(A,"class","post-meta d-flex justify-content-between"),W.src!==(B=s[4])&&o(W,"src",B),o(W,"onerror","this.src='me.jpg'"),o(W,"alt","..."),o(W,"class","img-fluid"),o(k,"class","avatar"),o(J,"class","title"),o(M,"href",Q=s[1]+"/posts/"+s[0].slug),o(M,"class","author d-flex align-items-center flex-wrap"),o(Z,"class","icon-clock"),o(Y,"class","date"),o(X,"class","d-flex align-items-center flex-wrap"),o(C,"class","post-footer d-flex align-items-center flex-column flex-sm-row"),o(es,"class","post-body"),o(cs,"class","posts-nav d-flex justify-content-between align-items-stretch\n          flex-column flex-md-row"),o(S,"class","post-details"),o(D,"class","post-single"),o(a,"class","container"),o(t,"class","post blog-post col-lg-12")},m(e,r){d(e,t,r),I(t,a),I(a,D),I(D,w),I(w,y),I(D,j),I(D,S),I(S,A),I(A,O),h(ps,O,null),I(S,R),I(S,H),I(H,L),I(S,G),I(S,C),I(C,M),I(M,k),I(k,W),I(M,F),I(M,J),I(J,K),I(K,z),I(C,U),I(C,X),I(X,Y),I(Y,Z),I(Y,ss),I(Y,ts),I(S,as),I(S,es),I(es,rs),rs.innerHTML=s[6],I(S,ls),ms&&ms.m(S,null),I(S,ns),I(S,cs),gs&&gs.m(cs,null),I(cs,is),vs&&vs.m(cs,null),I(t,os),Es&&Es.m(t,null),ds=!0},p(s,[a]){(!ds||8&a&&y.src!==(V=s[3]))&&o(y,"src",V);const e={};1&a&&(e.tags=s[0].tags),ps.$set(e),(!ds||1&a)&&hs!==(hs=s[0].title+"")&&x(L,hs),(!ds||16&a&&W.src!==(B=s[4]))&&o(W,"src",B),(!ds||1&a)&&fs!==(fs=s[0].author_name+"")&&x(z,fs),(!ds||3&a&&Q!==(Q=s[1]+"/posts/"+s[0].slug))&&o(M,"href",Q),(!ds||1&a)&&us!==(us=s[0].published_at+"")&&x(ts,us),s[0].tags?ms?(ms.p(s,a),f(ms,1)):((ms=N(s)).c(),f(ms,1),ms.m(S,ns)):ms&&($(),u(ms,1,1,()=>{ms=null}),b()),void 0!==s[0].prev.slug?gs?gs.p(s,a):((gs=T(s)).c(),gs.m(cs,is)):gs&&(gs.d(1),gs=null),void 0!==s[0].next.slug?vs?vs.p(s,a):((vs=q(s)).c(),vs.m(cs,null)):vs&&(vs.d(1),vs=null),s[2].allow_disqus?Es||((Es=P()).c(),Es.m(t,null)):Es&&(Es.d(1),Es=null)},i(s){ds||(f(ps.$$.fragment,s),f(ms),ds=!0)},o(s){u(ps.$$.fragment,s),u(ms),ds=!1},d(s){s&&i(t),p(ps),ms&&ms.d(),gs&&gs.d(),vs&&vs.d(),Es&&Es.d()}}}function A(s,t,a){let e,{post:r}=t;const{preloading:l,page:n,session:c}=w();D(s,n,s=>a(7,e=s));let{username:i=e.params.theuser}=t,{metadata:o={}}=t,d=new j.Converter({metadata:!0});d.setFlavor("github");let h=d.makeHtml(r.content),f=r.post_image,u="";u=f?f.startsWith("http")?f:`/blog_${i}/assets/images/${f}`:"img/blog-post-1.jpeg";let p=r.author_image,m="";return m=p?p.startsWith("http")?p:`/blog_${i}/assets/images/${p}`:"me.jpg",s.$set=(s=>{"post"in s&&a(0,r=s.post),"username"in s&&a(1,i=s.username),"metadata"in s&&a(2,o=s.metadata)}),[r,i,o,u,m,n,h]}class O extends s{constructor(s){super(),t(this,s,A,S,a,{post:0,username:1,metadata:2})}}function R(s){let t,a,n,g;document.title=t=s[0].title;const E=new O({props:{post:s[0],metadata:s[1]}});return{c(){a=e("link"),n=m(),r(E.$$.fragment),this.h()},l(s){a=l(s,"LINK",{rel:!0,href:!0}),n=v(s),c(E.$$.fragment,s),this.h()},h(){o(a,"rel","stylesheet"),o(a,"href","//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.8/build/styles/default.min.css")},m(s,t){I(document.head,a),d(s,n,t),h(E,s,t),g=!0},p(s,[a]){(!g||1&a)&&t!==(t=s[0].title)&&(document.title=t);const e={};1&a&&(e.post=s[0]),2&a&&(e.metadata=s[1]),E.$set(e)},i(s){g||(f(E.$$.fragment,s),g=!0)},o(s){u(E.$$.fragment,s),g=!1},d(s){i(a),s&&i(n),p(E,s)}}}async function H({params:s,query:t}){let a=s.theuser,e=s.slug;const r=await y(a);let l=await V(a);const n=new Map;return l.forEach((s,t)=>{if(s.prev={slug:void 0,title:void 0},s.next={slug:void 0,title:void 0},t>0){let a=l[t-1].slug,e=l[t-1].title;s.prev={slug:a,title:e}}if(t<l.length&&l[t+1]){let a=l[t+1].slug,e=l[t+1].title;s.next={slug:a,title:e}}n.set(s.slug,JSON.stringify(s))}),{post:JSON.parse(n.get(e)),metadata:r}}function L(s,t,a){let e,{post:r}=t,{metadata:l}=t;const{preloading:n,page:c,session:i}=w();D(s,c,s=>a(4,e=s));let{username:o=e.params.theuser}=t;return s.$set=(s=>{"post"in s&&a(0,r=s.post),"metadata"in s&&a(1,l=s.metadata),"username"in s&&a(3,o=s.username)}),[r,l,c,o]}export default class extends s{constructor(s){super(),t(this,s,L,R,a,{post:0,metadata:1,username:3})}}export{H as preload};
  