1import{a as l,_ as n}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{f as L,b as S,c as v,i as E}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{d as I}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import{u as U}from"./index-BRb-vGx1.js";import{d as w,b$ as p,c0 as y,b as $,c as D,O as A,s as T,c1 as G,m as M,c2 as P,v as O,j as z,bM as R}from"./index-C8DIms-h.js";import{u as j}from"./CreateAlbumDrawerContext-BrLdwoFb.js";import{u as k}from"./CreateGroupDrawerContext-CYmLA6sq.js";import{I as B}from"./en-US-CcscABQy.js";import{L as C}from"./LoadingIcon-BUCARp-P.js";import{f as H}from"./formatDistanceToNow-uO2sKiQN.js";import{P as V}from"./PlayCircleIcon-DfcCTPOe.js";import{f as W}from"./formatImageProxyUrl-Brvd124A.js";import{C as F}from"./ChevronRightIcon-BQI0NQ_h.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";const Y=L(function({title:t,description:o,buttonLabel:a,onClick:r,image:i},s){return l("div",{ref:s,className:"border-border bg-card flex flex-col gap-12 rounded-16 border p-12",children:[n("img",{src:i,alt:"",className:"aspect-[259/120] w-full rounded-12 object-cover object-center"}),l("div",{className:"flex flex-1 flex-col gap-4",children:[n("h3",{className:"text-foreground font-display text-base font-bold",children:t}),n("p",{className:"text-muted-foreground font-text text-sm",children:o})]}),n(w,{variant:"outline",onClick:r,className:"h-36 w-full rounded-24 border-brand-500 text-brand-600 font-display text-base font-semibold hover:bg-brand-500/10 hover:text-brand-600",children:a})]})}),q="/assets/png/get-started-setup-profile-4Me-o7vF.png",J="/assets/png/get-started-create-group-BPpbyplo.png",K="/assets/png/get-started-upload-media-CHL-eZPF.png",Q="/assets/png/get-started-add-album-DNJlRxS4.png",_=new Set;function X({tile:e,position:t}){const{trackEvent:o}=$(),a=D(),{ref:r,inView:i}=U({triggerOnce:!0,threshold:.5});return S(function(){!i||_.has(e.name)||(_.add(e.name),o(A.TILE_VIEWED,{tile_name:e.name,tile_position:t,platform:a}))},[i,e.name,t,a,o]),n(Y,{ref:r,title:e.title,description:e.description,buttonLabel:e.buttonLabel,image:e.image,onClick:()=>{var s;o(A.TILE_CLICKED,{tile_name:e.name,tile_position:t,platform:a}),(s=e.onClick)==null||s.call(e)}})}function Z(){const e=I(),{open:t}=j(),{open:o}=k(),a=[{name:p.SETUP_PROFILE,title:"Setup Profile",description:"Update your name and location to personalize your experience.",buttonLabel:"Setup Profile",image:q,onClick:()=>e("/settings")},{name:p.CREATE_GROUP,title:"Create a Group",description:"Create Groups of photos to share with your friends.",buttonLabel:"Create a Group",image:J,onClick:()=>o({entryPoint:y.ONBOARDING})},{name:p.UPLOAD_MEDIA,title:"Upload Media",description:"Add media to your personal Library and organize in Albums.",buttonLabel:"Upload Media",image:K,onClick:()=>e("/library")},{name:p.ADD_ALBUM,title:"Add an Album",description:"Add an Album to your Library to organize photos and videos.",buttonLabel:"Add an Album",image:Q,onClick:()=>t(void 0,{entryPoint:y.ONBOARDING,onCreated:r=>e("/library/albums/".concat(r.id))})}];return l("section",{className:"bg-card rounded-24 shadow-elevation-soft px-24 pt-24 pb-32",children:[n("h2",{className:"text-foreground font-display mb-16 text-2xl font-semibold",children:"Get Started"}),n("div",{className:"grid grid-cols-1 gap-24 md:grid-cols-2 lg:grid-cols-4",children:a.map((r,i)=>n(X,{tile:r,position:i+1},r.title))})]})}const ee="h-40 rounded-24 border-brand-500 px-24 text-base font-display font-semibold text-brand-600 hover:bg-brand-500/10 hover:text-brand-600";function te(){const{open:e}=k();return n("div",{className:"flex items-center gap-8",children:n(w,{variant:"ghost",className:ee,onClick:()=>e(),children:"Create a Group"})})}const ne=40,re={limit:ne,bucketType:M.Group,includeTypes:[G.UploadedMedia]};function oe(){var m;const{data:e,loading:t,error:o,fetchMore:a}=T(P,{variables:re,notifyOnNetworkStatusChange:!0}),r=(m=e==null?void 0:e.activities)==null?void 0:m.nextToken,i=v(()=>{var d,u;return((u=(d=e==null?void 0:e.activities)==null?void 0:d.items)!=null?u:[]).filter(f=>f.__typename==="UploadedMediaActivity")},[e]),s=v(()=>O.debounce(d=>a({variables:{nextToken:d}}),500,{leading:!0,trailing:!1}),[a]),c=E(()=>{r&&s(r)},[s,r]);return{items:i,loading:t,error:o,fetchMore:c,nextToken:r}}function ae(e){var r;const t=(r=e.albums)!=null?r:[];if(t.length!==1)return;const o=new Set(e.media.map(i=>{var s;return(s=i.albumId)!=null?s:null}));if(o.size>1)return;const[a]=o;return a&&a!==t[0].id?void 0:t[0]}function ie(e){if(!e)return"Unknown or Deleted User";const t=e.firstName||"",o=e.lastName||"";return t&&o?"".concat(t," ").concat(o):t||(e.email?e.email:"Unknown or Deleted User")}function se(e){var r,i;if(!e)return"?";const t=e.firstName||"",o=e.lastName||"";if(t&&o)return"".concat(t.charAt(0)).concat(o.charAt(0)).toUpperCase();if(t)return t.charAt(0).toUpperCase();const a=(r=e.email)==null?void 0:r.split("@")[0];return(i=a==null?void 0:a.substring(0,2).toUpperCase())!=null?i:"?"}function le(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":H(t,{addSuffix:!0})}function ce({avatar:e,initials:t}){return e?n("img",{src:e,alt:"",className:"size-40 shrink-0 rounded-full object-cover",loading:"lazy"}):n("div",{className:"bg-blue-300 font-display flex size-40 shrink-0 items-center justify-center rounded-full text-base font-semibold text-white",children:t})}function de({avatar:e,initials:t,name:o,actionText:a,linkText:r,timeText:i,onLinkPress:s}){return l("button",{type:"button",onClick:s,"aria-label":"".concat(o," ").concat(a," ").concat(r),className:"focus-visible:ring-ring flex w-full items-center gap-12 rounded-8 text-left outline-none focus-visible:ring-2",children:[n(ce,{avatar:e,initials:t}),l("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[l("div",{className:"flex flex-wrap items-baseline gap-x-4",children:[n("span",{className:"text-foreground font-display text-base font-semibold",children:o}),n("span",{className:"text-muted-foreground font-text text-base",children:a})]}),n("span",{className:"text-brand-600 font-display truncate text-sm font-semibold",children:r})]}),i&&n("span",{className:"text-muted-foreground font-text shrink-0 text-sm",children:i})]})}const b=5;function me(e,t){return t===1?"rounded-12":e===0?"rounded-l-12":e===t-1?"rounded-r-12":""}function ue({media:e,totalCount:t,onImagePress:o}){const r=e.filter(c=>!!c.imageUrl).slice(0,b);
1if(r.length===0)return null;const i=t-b,s=t>b;return n("div",{className:"grid grid-cols-5 gap-4",children:r.map((c,m)=>{const d=m===r.length-1;return l("button",{type:"button",onClick:()=>o==null?void 0:o(c),"aria-label":c.isVideo?"Play video":"View image",className:"focus-visible:ring-ring relative aspect-square overflow-hidden outline-none focus-visible:ring-2 ".concat(me(m,r.length)),children:[n("img",{src:W(c,320),alt:"",loading:"lazy",className:"size-full object-cover"}),c.isVideo&&n("span",{className:"absolute bottom-0 left-0 p-4 text-white",children:n(V,{size:"small"})}),s&&d&&l("span",{className:"font-display absolute inset-0 flex items-center justify-center bg-black/40 text-lg font-semibold text-white",children:["+",i]})]},c.id)})})}function fe({activity:e}){var f,h,x,N;const t=I(),o=ie(e.user),a=se(e.user),r=e.mediaCount,i=r===1?"image":"images",s=ae(e),c=s?"added ".concat(r," ").concat(i," to the album"):"added ".concat(r," ").concat(i," to the group"),m=s?(h=(f=s.title)!=null?f:e.bucketTitle)!=null?h:"":(x=e.bucketTitle)!=null?x:"",d=()=>{const g=s?"/groups/".concat(e.bucketId,"/albums/").concat(s.id):"/groups/".concat(e.bucketId);t(g)},u=g=>{t("/home/groups/".concat(e.bucketId,"/activity/").concat(e.activityId,"/media/").concat(g.id),{state:{returnUri:"/home"}})};return l("div",{className:"flex flex-col gap-12",children:[n(de,{avatar:(N=e.user)==null?void 0:N.avatar,initials:a,name:o,actionText:c,linkText:m,timeText:le(e.createdAt),onLinkPress:d}),n(ue,{media:e.media,totalCount:r,onImagePress:u})]})}function pe({title:e,onSeeAll:t}){return l("div",{className:"mb-16 flex items-center justify-between gap-16",children:[n("h2",{className:"text-foreground font-display text-lg font-bold",children:e}),t&&l("button",{type:"button",onClick:t,className:"text-brand-600 font-display focus-visible:ring-ring flex items-center gap-4 roun
1ded-4 text-base font-semibold outline-none focus-visible:ring-2",children:["See all",n(F,{size:"xsmall"})]})]})}function ge({items:e,loading:t,error:o,fetchMore:a,nextToken:r}){return t&&e.length===0?n("div",{className:"flex justify-center py-32",children:n(C,{size:"large",className:"text-muted-foreground animate-spin","aria-label":"Loading activity"})}):o&&e.length===0?n("p",{className:"text-muted-foreground font-text py-16 text-base",children:"Something went wrong loading your activity. Please try again."}):e.length===0?n("p",{className:"text-muted-foreground font-text py-16 text-base",children:"No recent activity yet."}):n(B,{dataLength:e.length,next:a,hasMore:!!r,scrollableTarget:"home-scroll",className:"flex flex-col gap-32",loader:n("div",{className:"flex justify-center py-16",children:n(C,{size:"large",className:"text-muted-foreground animate-spin","aria-label":"Loading more activity"})}),children:e.map(i=>n(fe,{activity:i},i.activityId))})}function be(){const{items:e,loading:t,error:o,fetchMore:a,nextToken:r}=oe();return l("section",{children:[n(pe,{title:"Latest Activity"}),n(ge,{items:e,loading:t,error:o,fetchMore:a,nextToken:r})]})}function he(){var o,a;const{data:e}=T(R,{skip:!z().currentUser}),t=(a=(o=e==null?void 0:e.userProfile)==null?void 0:o.firstName)==null?void 0:a.trim();return n("h1",{className:"text-foreground font-display text-3xl font-bold",children:t?"Welcome ".concat(t,"!"):"Welcome!"})}function Re(){return l("main",{id:"home-scroll",className:"h-full overflow-y-auto px-24 py-24",children:[n("div",{className:"mb-16 flex justify-end",children:n(te,{})}),n(he,{}),l("div",{className:"mt-16 flex flex-col gap-32",children:[n(Z,{}),n(be,{})]})]})}export{Re as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.