1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
import{a as it,c as et,n as tt}from"./utils-AUSSiI9x.js";import{a as p,l as y,t as R,b as u,f as h,d as s,m as k,h as J,j as S,i as I,k as e,n as F,H as ft,c as pt,p as me,q as ut,e as at}from"./lifecycle-CTLfn-qA.js";import{S as ct,i as dt,c as _e,b as he,m as ve,t as q,e as Ue,a as O,d as ge,g as Be}from"./index-BYiPtpSv.js";import{e as lt}from"./each-Dkr21eUC.js";import{$ as mt,a as _t}from"./runtime-VldLyBWb.js";import{c as ht,N as vt}from"./ZoomOut24-BdlMg8bU.js";import{A as gt}from"./Avatar-BW-Q_HeY.js";import{B as bt}from"./BlockOrReport-BcdCyU0q.js";import{C as Et}from"./Created-CXrMcAul.js";import{D as $t}from"./DisplayName-DiyeejRw.js";import{P as yt}from"./Project-Bc9PiiHe.js";function st(r,t,f){const a=r.slice();return a[6]=t[f],a}function kt(r){let t,f=r[2]("page.profile.projects.empty")+"",a,c,o,d=r[2]("page.profile.projects.add_or_import",{values:{addElementOpen:'<a class="anchor" href="#">',addElementClose:"</a>",importElementOpen:`<a class="anchor" href="/projects/import/" data-sb-kind=${r[1]}>`,importElementClose:"</a>"}})+"";return{c(){t=p("p"),a=R(f),c=y(),o=new ft(!1),this.h()},l(m){t=u(m,"P",{class:!0});var E=h(t);a=J(E,f),c=k(E),o=pt(E,!1),E.forEach(s),this.h()},h(){o.a=null,S(t,"class","px-4")},m(m,E){I(m,t,E),e(t,a),e(t,c),o.m(d,t)},p(m,E){E&4&&f!==(f=m[2]("page.profile.projects.empty")+"")&&F(a,f),E&6&&d!==(d=m[2]("page.profile.projects.add_or_import",{values:{addElementOpen:'<a class="anchor" href="#">',addElementClose:"</a>",importElementOpen:`<a class="anchor" href="/projects/import/" data-sb-kind=${m[1]}>`,importElementClose:"</a>"}})+"")&&o.p(d)},i:tt,o:tt,d(m){m&&s(t)}}}function wt(r){var P;let t,f,a,c,o="The following is DEBUG information and will be removed in the near future.",d,m,E=lt(r[0].user.followingsMap),l=[];for(let n=0;n<E.length;n+=1)l[n]=nt(st(r,E,n));const T=n=>q(l[n],1,1,()=>{l[n]=null});let g=((P=r[0])==null?void 0:P.user)&&ot(r);return{c(){t=p("ul");for(let n=0;n<l.length;n+=1)l[n].c();f=y(),a=p("div"),c=p("p"),c.textContent=o,d=y(),g&&g.c()},l(n){t=u(n,"UL",{});var _=h(t);for(let v=0;v<l.length;v+=1)l[v].l(_);_.forEach(s),f=k(n),a=u(n,"DIV",{});var w=h(a);c=u(w,"P",{"data-svelte-h":!0}),me(c)!=="svelte-qlo5bs"&&(c.textContent=o),d=k(w),g&&g.l(w),w.forEach(s)},m(n,_){I(n,t,_);for(let w=0;w<l.length;w+=1)l[w]&&l[w].m(t,null);I(n,f,_),I(n,a,_),e(a,c),e(a,d),g&&g.m(a,null),m=!0},p(n,_){var w;if(_&49){E=lt(n[0].user.followingsMap);let v;for(v=0;v<E.length;v+=1){const N=st(n,E,v);l[v]?(l[v].p(N,_),O(l[v],1)):(l[v]=nt(N),l[v].c(),O(l[v],1),l[v].m(t,null))}for(Be(),v=E.length;v<l.length;v+=1)T(v);Ue()}(w=n[0])!=null&&w.user?g?g.p(n,_):(g=ot(n),g.c(),g.m(a,null)):g&&(g.d(1),g=null)},i(n){if(!m){for(let _=0;_<E.length;_+=1)O(l[_]);m=!0}},o(n){l=l.filter(Boolean);for(let _=0;_<l.length;_+=1)q(l[_]);m=!1},d(n){n&&(s(t),s(f),s(a)),ut(l,n),g&&g.d()}}}function rt(r){let t,f,a,c;return f=new yt({props:{collaborators:r[5]([r[0].user.person],r[0].user.collaboratorsMap,r[6].id),i18n:r[4],project:r[6]}}),{c(){t=p("li"),_e(f.$$.fragment),a=y()},l(o){t=u(o,"LI",{});var d=h(t);he(f.$$.fragment,d),a=k(d),d.forEach(s)},m(o,d){I(o,t,d),ve(f,t,null),e(t,a),c=!0},p(o,d){const m={};d&1&&(m.collaborators=o[5]([o[0].user.person],o[0].user.collaboratorsMap,o[6].id)),d&1&&(m.project=o[6]),f.$set(m)},i(o){c||(O(f.$$.fragment,o),c=!0)},o(o){q(f.$$.fragment,o),c=!1},d(o){o&&s(t),ge(f)}}}function nt(r){let t,f,a=r[6].type==="Project"&&rt(r);return{c(){a&&a.c(),t=at()},l(c){a&&a.l(c),t=at()},m(c,o){a&&a.m(c,o),I(c,t,o),f=!0},p(c,o){c[6].type==="Project"?a?(a.p(c,o),o&1&&O(a,1)):(a=rt(c),a.c(),O(a,1),a.m(t.parentNode,t)):a&&(Be(),q(a,1,1,()=>{a=null}),Ue())},i(c){f||(O(a),f=!0)},o(c){q(a),f=!1},d(c){c&&s(t),a&&a.d(c)}}}function ot(r){let t,f,a="Person",c,o,d=JSON.stringify(r[0].user.person,null,2)+"",m,E,l,T,g="Followings",P,n,_=JSON.stringify(r[0].user.followings,null,2)+"",w,v,N,G,be="Followings mapped",ae,x,Ee="These are the contents of the items in the previous dump.",z,L,Z=JSON.stringify(r[0].user.followingsMap,null,2)+"",V,K,j,U,re="Collaborators mapped",ne,ee,M="These are the contents of the items in the previous dump.",D,le,Y=JSON.stringify(r[0].user.collaboratorsMap,null,2)+"",B;return{c(){t=p("details"),f=p("summary"),f.textContent=a,c=y(),o=p("pre"),m=R(d),E=y(),l=p("details"),T=p("summary"),T.textContent=g,P=y(),n=p("pre"),w=R(_),v=y(),N=p("details"),G=p("summary"),G.textContent=be,ae=y(),x=p("p"),x.textContent=Ee,z=y(),L=p("pre"),V=R(Z),K=y(),j=p("details"),U=p("summary"),U.textContent=re,ne=y(),ee=p("p"),ee.textContent=M,D=y(),le=p("pre"),B=R(Y)},l(b){t=u(b,"DETAILS",{});var C=h(t);f=u(C,"SUMMARY",{"data-svelte-h":!0}),me(f)!=="svelte-124pn6b"&&(f.textContent=a),c=k(C),o=u(C,"PRE",{});var de=h(o);m=J(de,d),de.forEach(s),C.forEach(s),E=k(b),l=u(b,"DETAILS",{});var oe=h(l);T=u(oe,"SUMMARY",{"data-svelte-h":!0}),me(T)!=="svelte-akj1jk"&&(T.textContent=g),P=k(oe),n=u(oe,"PRE",{});var ie=h(n);w=J(ie,_),ie.forEach(s),oe.forEach(s),v=k(b),N=u(b,"DETAILS",{});var A=h(N);G=u(A,"SUMMARY",{"data-svelte-h":!0}),me(G)!=="svelte-nlexcn"&&(G.textContent=be),ae=k(A),x=u(A,"P",{"data-svelte-h":!0}),me(x)!=="svelte-1js943j"&&(x.textContent=Ee),z=k(A),L=u(A,"PRE",{});var Q=h(L);V=J(Q,Z),Q.forEach(s),A.forEach(s),K=k(b),j=u(b,"DETAILS",{});var H=h(j);U=u(H,"SUMMARY",{"data-svelte-h":!0}),me(U)!=="svelte-xs39bg"&&(U.textContent=re),ne=k(H),ee=u(H,"P",{"data-svelte-h":!0}),me(ee)!=="svelte-1js943j"&&(ee.textContent=M),D=k(H),le=u(H,"PRE",{});var te=h(le);B=J(te,Y),te.forEach(s),H.forEach(s)},m(b,C){I(b,t,C),e(t,f),e(t,c),e(t,o),e(o,m),I(b,E,C),I(b,l,C),e(l,T),e(l,P),e(l,n),e(n,w),I(b,v,C),I(b,N,C),e(N,G),e(N,ae),e(N,x),e(N,z),e(N,L),e(L,V),I(b,K,C),I(b,j,C),e(j,U),e(j,ne),e(j,ee),e(j,D),e(j,le),e(le,B)},p(b,C){C&1&&d!==(d=JSON.stringify(b[0].user.person,null,2)+"")&&F(m,d),C&1&&_!==(_=JSON.stringify(b[0].user.followings,null,2)+"")&&F(w,_),C&1&&Z!==(Z=JSON.stringify(b[0].user.followingsMap,null,2)+"")&&F(V,Z),C&1&&Y!==(Y=JSON.stringify(b[0].user.collaboratorsMap,null,2)+"")&&F(B,Y)},d(b){b&&(s(t),s(E),s(l),s(v),s(N),s(K),s(j))}}}function Ct(r){let t,f,a,c,o,d,m,E,l,T,g,P,n,_,w,v,N=r[0].user.username+"",G,be,ae=r[0].user.instance+"",x,Ee,z,L,Z,V,K,j,U,re=r[2]("page.profile.projects.heading")+"",ne,ee,M,D,le,Y,B,b,C=r[2]("page.profile.history.heading")+"",de,oe,ie,A,Q,H,te,Re,fe,ke=r[3](new Date("2023-04-23"))+"",Se,Je,we=r[2]("page.profile.history.activities.setup.summary")+"",je,Le,$e,ye,Ce=r[2]("page.profile.history.activities.setup.description",{values:{created_with:r[0].user.created_with,instance:r[0].user.instance,username:r[0].user.username}})+"",Ne,W;a=new gt({props:{avatar:r[0].user.avatar,displayName:r[0].user.display_name}}),m=new Et({props:{created_at:r[0].user.created_at,locale:r[0].locale}}),l=new bt({}),_=new $t({props:{displayName:r[0].user.display_name,i18n:r[4],pronoun:r[0].user.pronoun}}),L=new ht({props:{fill:"currentColor"}});const He=[wt,kt],pe=[];function qe(i,$){var se,X;return(X=(se=i[0])==null?void 0:se.user)!=null&&X.followingsMap?0:1}return M=qe(r),D=pe[M]=He[M](r),te=new vt({props:{fill:"currentColor"}}),{c(){t=p("section"),f=p("div"),_e(a.$$.fragment),c=y(),o=p("div"),d=p("div"),_e(m.$$.fragment),E=y(),_e(l.$$.fragment),T=y(),g=p("div"),P=p("div"),n=p("div"),_e(_.$$.fragment),w=y(),v=p("span"),G=R(N),be=R("@"),x=R(ae),Ee=y(),z=p("button"),_e(L.$$.fragment),Z=y(),V=p("section"),K=p("div"),j=p("div"),U=p("h2"),ne=R(re),ee=y(),D.c(),le=y(),Y=p("div"),B=p("div"),b=p("h2"),de=R(C),oe=y(),ie=p("ul"),A=p("li"),Q=p("span"),H=p("span"),_e(te.$$.fragment),Re=y(),fe=p("span"),Se=R(ke),Je=R(" - "),je=R(we),Le=y(),$e=p("span"),ye=p("span"),Ne=R(Ce),this.h()},l(i){t=u(i,"SECTION",{class:!0});var $=h(t);f=u($,"DIV",{});var se=h(f);he(a.$$.fragment,se),se.forEach(s),c=k($),o=u($,"DIV",{class:!0});var X=h(o);d=u(X,"DIV",{class:!0});var ue=h(d);he(m.$$.fragment,ue),E=k(ue),he(l.$$.fragment,ue),ue.forEach(s),T=k(X),g=u(X,"DIV",{class:!0});var ce=h(g);P=u(ce,"DIV",{class:!0});var Pe=h(P);n=u(Pe,"DIV",{class:!0});var Ye=h(n);he(_.$$.fragment,Ye),Ye.forEach(s),w=k(Pe),v=u(Pe,"SPAN",{class:!0});var De=h(v);G=J(De,N),be=J(De,"@"),x=J(De,ae),De.forEach(s),Pe.forEach(s),Ee=k(ce),z=u(ce,"BUTTON",{type:!0,class:!0});var Fe=h(z);he(L.$$.fragment,Fe),Fe.forEach(s),ce.forEach(s),X.forEach(s),$.forEach(s),Z=k(i),V=u(i,"SECTION",{class:!0});var Ie=h(V);K=u(Ie,"DIV",{class:!0});var Ge=h(K);j=u(Ge,"DIV",{class:!0});var Me=h(j);U=u(Me,"H2",{class:!0});var xe=h(U);ne=J(xe,re),xe.forEach(s),ee=k(Me),D.l(Me),Me.forEach(s),Ge.forEach(s),le=k(Ie),Y=u(Ie,"DIV",{class:!0});var ze=h(Y);B=u(ze,"DIV",{class:!0});var Ae=h(B);b=u(Ae,"H2",{class:!0});var Ke=h(b);de=J(Ke,C),Ke.forEach(s),oe=k(Ae),ie=u(Ae,"UL",{});var Qe=h(ie);A=u(Qe,"LI",{class:!0});var Oe=h(A);Q=u(Oe,"SPAN",{class:!0});var Te=h(Q);H=u(Te,"SPAN",{class:!0});var We=h(H);he(te.$$.fragment,We),We.forEach(s),Re=k(Te),fe=u(Te,"SPAN",{class:!0});var Ve=h(fe);Se=J(Ve,ke),Je=J(Ve," - "),je=J(Ve,we),Ve.forEach(s),Te.forEach(s),Le=k(Oe),$e=u(Oe,"SPAN",{class:!0});var Xe=h($e);ye=u(Xe,"SPAN",{class:!0});var Ze=h(ye);Ne=J(Ze,Ce),Ze.forEach(s),Xe.forEach(s),Oe.forEach(s),Qe.forEach(s),Ae.forEach(s),ze.forEach(s),Ie.forEach(s),this.h()},h(){S(d,"class","self-end"),S(n,"class","flex items-end"),S(v,"class","leading-tight"),S(P,"class","flex flex-col flex-1 gap-2"),S(z,"type","button"),S(z,"class","btn-icon border rounded-none self-start"),S(g,"class","flex mt-2"),S(o,"class","flex flex-1 flex-col ps-8"),S(t,"class","w-full mx-auto flex px-8 pt-8"),S(U,"class","h2 font-semibold leading-tight text-base px-4"),S(j,"class","space-y-6"),S(K,"class","flex flex-1 flex-col px-4"),S(b,"class","h2 font-semibold leading-tight text-base"),S(H,"class","absolute ltr:-left-3 rtl:-right-3"),S(fe,"class","ms-4"),S(Q,"class","relative"),S(ye,"class","border box-decoration-clone px-4 py-2 leading-10"),S($e,"class","ms-6 mt-8"),S(A,"class","flex flex-col ltr:border-l-2 rtl:border-r-2 ms-2"),S(B,"class","space-y-6"),S(Y,"class","flex flex-1 flex-col px-4"),S(V,"class","w-full h-full mx-auto flex mt-8 px-8")},m(i,$){I(i,t,$),e(t,f),ve(a,f,null),e(t,c),e(t,o),e(o,d),ve(m,d,null),e(d,E),ve(l,d,null),e(o,T),e(o,g),e(g,P),e(P,n),ve(_,n,null),e(P,w),e(P,v),e(v,G),e(v,be),e(v,x),e(g,Ee),e(g,z),ve(L,z,null),I(i,Z,$),I(i,V,$),e(V,K),e(K,j),e(j,U),e(U,ne),e(j,ee),pe[M].m(j,null),e(V,le),e(V,Y),e(Y,B),e(B,b),e(b,de),e(B,oe),e(B,ie),e(ie,A),e(A,Q),e(Q,H),ve(te,H,null),e(Q,Re),e(Q,fe),e(fe,Se),e(fe,Je),e(fe,je),e(A,Le),e(A,$e),e($e,ye),e(ye,Ne),W=!0},p(i,[$]){const se={};$&1&&(se.avatar=i[0].user.avatar),$&1&&(se.displayName=i[0].user.display_name),a.$set(se);const X={};$&1&&(X.created_at=i[0].user.created_at),$&1&&(X.locale=i[0].locale),m.$set(X);const ue={};$&1&&(ue.displayName=i[0].user.display_name),$&1&&(ue.pronoun=i[0].user.pronoun),_.$set(ue),(!W||$&1)&&N!==(N=i[0].user.username+"")&&F(G,N),(!W||$&1)&&ae!==(ae=i[0].user.instance+"")&&F(x,ae),(!W||$&4)&&re!==(re=i[2]("page.profile.projects.heading")+"")&&F(ne,re);let ce=M;M=qe(i),M===ce?pe[M].p(i,$):(Be(),q(pe[ce],1,1,()=>{pe[ce]=null}),Ue(),D=pe[M],D?D.p(i,$):(D=pe[M]=He[M](i),D.c()),O(D,1),D.m(j,null)),(!W||$&4)&&C!==(C=i[2]("page.profile.history.heading")+"")&&F(de,C),(!W||$&8)&&ke!==(ke=i[3](new Date("2023-04-23"))+"")&&F(Se,ke),(!W||$&4)&&we!==(we=i[2]("page.profile.history.activities.setup.summary")+"")&&F(je,we),(!W||$&5)&&Ce!==(Ce=i[2]("page.profile.history.activities.setup.description",{values:{created_with:i[0].user.created_with,instance:i[0].user.instance,username:i[0].user.username}})+"")&&F(Ne,Ce)},i(i){W||(O(a.$$.fragment,i),O(m.$$.fragment,i),O(l.$$.fragment,i),O(_.$$.fragment,i),O(L.$$.fragment,i),O(D),O(te.$$.fragment,i),W=!0)},o(i){q(a.$$.fragment,i),q(m.$$.fragment,i),q(l.$$.fragment,i),q(_.$$.fragment,i),q(L.$$.fragment,i),q(D),q(te.$$.fragment,i),W=!1},d(i){i&&(s(t),s(Z),s(V)),ge(a),ge(m),ge(l),ge(_),ge(L),pe[M].d(),ge(te)}}}function St(r,t,f){let a,c;et(r,mt,l=>f(2,a=l)),et(r,_t,l=>f(3,c=l));const o={buttons:{fork:"page.profile.projects.actions.fork",star:"page.profile.projects.actions.star",watch:"page.profile.projects.actions.watch"},heading:"page.profile.heading"};let{data:d={locale:"",user:{avatar:"",created_at:null,created_with:"",display_name:"",instance:"",pronoun:"",username:""}}}=t,{sb:m=""}=t;const E=function(l,T,g){return T.filter(n=>n.context===g).map(n=>n.items).map(n=>l.find(_=>n.find(w=>_.id===w.object))).flat(1)};return r.$$set=l=>{"data"in l&&f(0,d=l.data),"sb"in l&&f(1,m=l.sb)},[d,m,a,c,o,E]}class jt extends ct{constructor(t){super(),dt(this,t,St,Ct,it,{data:0,sb:1})}}jt.__docgen={version:3,name:"Profile.svelte",data:[{keywords:[{name:"type",description:"{*}"}],visibility:"public",description:"Required context for populating the template.",name:"data",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"*",type:"any"}},{keywords:[],visibility:"public",description:"Allow for linking stories in Storybook.",name:"sb",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};export{jt as P};
|