var B=(V,E,a)=>new Promise((x,w)=>{var b=k=>{try{n(a.next(k))}catch(i){w(i)}},t=k=>{try{n(a.throw(k))}catch(i){w(i)}},n=k=>k.done?x(k.value):Promise.resolve(k.value).then(b,t);n((a=a.apply(V,E)).next())});import{s as K,p as ee,r as f,q as I,h as s,v as z,x as ce,f as c,g as F,i as e,k as o,t as A,F as te,m as oe,T as Me,y as Fe,e as me,b as pe,o as we,V as be,A as se,W as Le,l as ae,C as Se,n as De,B as Ee,j as _e}from"./vendor-vue.CmaRnji1.js";import{_ as de,dr as ne,u as ie,a as re,i as H,f as q,ds as ke,S as xe,A as fe}from"./index.CjrDwa0W.js";import{O as ue}from"./OneInputModal.DRJpYsK_.js";import{C as Te}from"./CrossFade.B9Ap6pL9.js";import{c as je}from"./UploadPhoto.Bqd-ApD8.js";import"./vendor.DSdF8huI.js";import"./swiper.tg5sgs8j.js";/* empty css */const Ae={key:0,class:"w-full h-[503em] absolute bottom-0 z-[50] bg-white dark:bg-[#1e1e1e] rounded-[20em]"},Oe={class:"w-full h-[48em] flex items-center justify-center border-b border-[#0000001A] dark:border-[#FFFFFF1A]"},Be={class:"w-[90%] h-[30%] flex justify-between items-center"},Ne={style:{"letter-spacing":"-0.23px"},class:"text-[13em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] text-center"},He={class:"w-full h-[calc(100%-48em)] px-[20em] overflow-auto no-scrollbar"},Ve={class:"w-full h-full flex flex-wrap justify-center items-center"},Re={xmlns:"http://www.w3.org/2000/svg",class:"h-[40%]",viewBox:"0 0 62 62",fill:"none"},Ie=["fill"],Ze={class:"text-[13em] font-['SFPRO'] w-full text-black dark:text-white font-[400] text-center leading-[100%]"},ze=["onClick"],Ue=["src"],Ye={key:1,class:"w-full h-full flex items-center bg-black/5 dark:bg-white/5 justify-center"},qe={class:"h-[40%]",viewBox:"0 0 58 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},We=["fill"],Ge={key:2,class:"w-full h-full"},Xe=["src"],Je={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Ke={class:"w-[35px] h-[35px] rounded-full flex items-center justify-center group-hover:scale-110 transition-transform duration-200"},Qe=["src"],et={class:"w-full h-full absolute top-0 left-0 z-[100] flex items-end",style:{background:"linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, transparent 50%)"}},tt={style:{"letter-spacing":"-0.4px"},class:"text-[13em] font-['SFPRO'] text-black dark:text-white font-[400] text-center leading-[100%] ml-[1em] mb-[1em]"},ot={__name:"AddToCollection",props:{show:{type:Boolean,default:!1}},emits:["close","newcollection","selectAlbum"],setup(V,{emit:E}){const a=ne(),x=ie(),{ScrollPage:w}=K(a),{DarkMode:b}=K(x),{t}=re();ee(()=>{b.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const n=E,k=V,i=()=>{n("close")},_=f(!1),u=()=>{_.value=!0},y=$=>{var L;const v=(((L=w.value.photos)==null?void 0:L.loadedData)||[]).filter(S=>S.album_id===$);let P=v.length>0?v[0].media:"",N=x.isVideo(P);return{url:P,isVideo:N}},T=$=>B(this,null,function*(){const h=yield q("CREATE_NEW_ALBUM",{name:$.name});h.success?(_.value=!1,a.NewAlbum(h.data)):x.TriggerNotification({appname:"photos",header:t("photos.title"),message:t(h.message)||h.message||t("photos.errors.createAlbumFailed")})});return($,h)=>(s(),I(Fe,{to:"#phone-screen"},[z(Me,{name:"slide-up"},{default:ce(()=>[k.show?(s(),c("div",Ae,[_.value?(s(),I(ue,{key:0,onBack:h[0]||(h[0]=v=>_.value=!1),onAdd:T,header:o(t)("photos.createNewCollection"),label:o(t)("photos.fillDetailsToCreateCollection"),fields:{name:{placeholder:o(t)("photos.collectionName"),value:""}},buttons:{cancel:o(t)("general.cancel"),submit:o(t)("general.add")}},null,8,["header","label","fields","buttons"])):F("",!0),e("div",Oe,[e("div",Be,[e("span",Ne,A(o(t)("photos.addToCollection")),1),e("div",{onClick:i,class:"flex bg-white dark:bg-black/40 text-black dark:text-white items-center justify-center w-[25em] h-[25em] cursor-pointer anim-hover-1 rounded-full shadow-[0_0_10.9px_0_rgba(0,0,0,0.15)]"},h[1]||(h[1]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",class:"injected-svg h-[60%]","data-src":"https://cdn.hugeicons.com/icons/cancel-01-solid-standard.svg?v=3.0","xmlns:xlink":"http://www.w3.org/1999/xlink",role:"img"},[e("path",{fill:"currentColor",d:"M17.293 5.29295C17.6835 4.90243 18.3165 4.90243 18.707 5.29295C19.0975 5.68348 19.0975 6.31649 18.707 6.70702L13.4131 12L18.706 17.293L18.7754 17.3691C19.0954 17.7619 19.072 18.341 18.706 18.707C18.3399 19.0731 17.7609 19.0958 17.3681 18.7754L17.292 18.707L11.999 13.414L6.70799 18.706C6.31747 19.0966 5.68446 19.0965 5.29393 18.706C4.90341 18.3155 4.90341 17.6825 5.29393 17.292L10.5849 12L5.29295 6.70799L5.22459 6.63182C4.9042 6.23907 4.92688 5.66007 5.29295 5.29393C5.65894 4.92794 6.23808 4.9046 6.63084 5.22459L6.70702 5.29393L11.999 10.5859L17.293 5.29295Z"})],-1)]))])]),e("div",He,[e("div",{onClick:u,class:"w-full h-[133em] p-[15em] mt-[12em] bg-black/5 dark:bg-white/5 rounded-[15em] cursor-pointer anim-hover-1"},[e("div",Ve,[(s(),c("svg",Re,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M33.4756 0.250001C40.0024 0.249941 42.2065 0.249911 46.2868 0.798461C50.5 1.36492 53.9614 2.56525 56.6986 5.30242C59.4358 8.03959 60.6361 11.501 61.2025 15.7141C61.6942 19.3728 61.7452 25.141 61.7503 31L61.7311 35.5111C61.7053 40.7362 61.5874 44.9617 60.9724 48.3676C60.3454 51.8383 59.1709 54.6517 56.9053 56.9173C54.3307 59.4919 51.0541 60.6529 46.924 61.2082C42.8938 61.75 37.7317 61.75 31.1596 61.75H30.8164C24.2445 61.75 19.0824 61.75 15.0522 61.2082C10.9222 60.6529 7.64549 59.4919 5.07089 56.9173C2.80538 54.6517 1.63088 51.8383 1.004 48.3676C0.388787 44.9617 0.270857 40.7362 0.245117 35.5111L0.251537 30.9997C0.256727 25.1407 0.307517 19.3728 0.799427 15.7141C1.36586 11.501 2.56619 8.03959 5.30336 5.30242C8.04053 2.56525 11.502 1.36492 15.7151 0.798461C19.7955 0.249881 24.9997 0.249941 31.5274 0.250001H33.4756ZM55.2559 16.5136C55.723 19.9868 55.7494 25.8949 55.7509 32.3497C55.7509 32.8465 55.348 33.25 54.8509 33.25H44.7112C40.8706 33.25 38.3047 36.3694 37.0732 38.8369C36.2026 40.5814 34.5118 42.25 30.988 42.25C27.4642 42.25 25.7737 40.5814 24.903 38.8369C23.6715 36.3694 21.1057 33.25 17.2651 33.25H7.15094C6.6539 33.25 6.25091 32.8465 6.25103 32.3497C6.25247 25.8949 6.27896 19.9868 6.74591 16.5136C7.22291 12.9658 8.10944 10.9816 9.54599 9.54505C10.9826 8.1085 12.9668 7.22197 16.5146 6.74497C20.1487 6.25636 26.4487 6.25 33.2509 6.25C40.0531 6.25 41.8531 6.25636 45.4873 6.74497C49.0351 7.22197 51.0193 8.1085 52.456 9.54505C53.8924 10.9816 54.7789 12.9658 55.2559 16.5136Z",fill:o(b)?"#FFFFFFB2":"#000000B2","fill-opacity":"0.7"},null,8,Ie)])),e("span",Ze,A(o(t)("photos.createNewCollection")),1)])]),(s(!0),c(te,null,oe(o(w).albums,v=>(s(),c("div",{onClick:P=>n("selectAlbum",v.id),class:"w-full h-[133em] mt-[12em] cursor-pointer anim-hover-1 relative rounded-[15em] overflow-hidden"},[!y(v.id).isVideo&&y(v.id).url?(s(),c("img",{key:0,src:y(v.id).url,class:"h-full object-cover w-full object-top absolute top-0",alt:""},null,8,Ue)):!y(v.id).isVideo&&!y(v.id).url?(s(),c("div",Ye,[(s(),c("svg",qe,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M34.4031 2.23551e-06C39.1551 -7.77645e-05 42.9852 -0.00013121 45.9978 0.403949C49.1255 0.823469 51.7588 1.72096 53.8503 3.80763C55.9418 5.89427 56.8415 8.52155 57.262 11.6419C57.6668 14.6474 57.6668 18.4688 57.6668 23.2096V28.7904C57.6668 33.5312 57.6668 37.3525 57.262 40.3581C56.8415 43.4784 55.9418 46.1059 53.8503 48.1923C51.7588 50.2789 49.1255 51.1765 45.9978 51.596C42.9852 52 39.1551 52 34.4031 52H23.5973C18.8453 52 15.015 52 12.0026 51.596C8.87491 51.1765 6.2415 50.2789 4.14998 48.1923C2.05848 46.1059 1.15888 43.4784 0.738378 40.3581C0.333365 37.3525 0.333418 33.5312 0.333498 28.7904V23.2099C0.333418 18.469 0.333365 14.6474 0.738378 11.6419C1.15888 8.52155 2.05848 5.89427 4.14998 3.80763C6.2415 1.72096 8.87491 0.823469 12.0026 0.403949C15.015 -0.00013121 18.8453 -7.77645e-05 23.5973 2.23551e-06H34.4031ZM23.6668 16.6667C23.6668 18.8758 21.876 20.6667 19.6668 20.6667C17.4577 20.6667 15.6668 18.8758 15.6668 16.6667C15.6668 14.4575 17.4577 12.6667 19.6668 12.6667C21.876 12.6667 23.6668 14.4575 23.6668 16.6667ZM7.83553 44.5155C6.87385 43.556 6.24683 42.2091 5.90403 39.6651L5.88323 39.5067L13.4119 31.0368C13.9981 30.3773 14.8383 30 15.7207 30C16.5399 30 17.3256 30.3253 17.9049 30.9048L23.6668 36.6667L36.0858 24.2477C36.6714 23.6624 37.4655 23.3333 38.2935 23.3333C39.1687 23.3333 40.0036 23.7005 40.5948 24.3459L52.3247 37.1421C52.2724 38.0661 52.1991 38.9019 52.0964 39.6651C51.7535 42.2091 51.1266 43.556 50.1647 44.5155C49.2031 45.4749 47.853 46.1005 45.3034 46.4424C42.6786 46.7944 39.1999 46.8 34.2124 46.8H23.7882C18.8004 46.8 15.3217 46.7944 12.6971 46.4424C10.1474 46.1005 8.7972 45.4749 7.83553 44.5155Z",fill:o(b)?"#FFFFFFB2":"#000000B2"},null,8,We)]))])):(s(),c("div",Ge,[e("video",{class:"w-full h-full object-cover",src:y(v.id).url,preload:"metadata",muted:""},"Your browser does not support the video tag.",8,Xe),e("div",Je,[e("div",Ke,[e("img",{src:o(H)["photos/play.svg"],class:"h-[80%]",alt:""},null,8,Qe)])])])),e("div",et,[e("span",tt,A(v.name),1)])],8,ze))),256)),h[2]||(h[2]=e("div",{class:"w-full h-[133px]"},null,-1))])])):F("",!0)]),_:1})]))}},ye=de(ot,[["__scopeId","data-v-5f523397"]]);function lt(V={}){const{loadMore:E,canLoad:a=()=>!0,isLoading:x=()=>!1,rootMargin:w=200,threshold:b=.1,onLoadStart:t=null,onLoadEnd:n=null,onError:k=null}=V,i=f(null),_=f(null);let u=null,y=!1,T=!1;const $=()=>{!i.value||!_.value||u||(u=new IntersectionObserver(P=>B(this,null,function*(){const L=P[0].isIntersecting;if(L&&!T&&a()&&!x())try{t==null||t(),yield E(),n==null||n()}catch(S){k==null||k(S),console.error("useInfiniteScroll: Error loading more:",S)}T=L}),{threshold:b,root:_.value,rootMargin:`0px 0px ${w}px 0px`}),u.observe(i.value),y=!0)},h=()=>{i.value&&u&&y&&(u.unobserve(i.value),T=!1,u.observe(i.value))},v=()=>{u&&(u.disconnect(),u=null,y=!1)};return ee(()=>{i.value&&_.value&&!u&&$()}),me(v),{sentinel:i,scrollContainer:_,cleanup:v,refreshObserver:h}}const st={class:"w-full h-full bg-[#F2F2F7] dark:bg-black"},at={class:"main-photos-page"},nt={class:"w-full h-[90em] flex items-end justify-center absolute top-0 z-[2]"},it={class:"w-full h-[44em]"},rt={class:"w-full h-[29em] flex justify-center"},ct={class:"w-[91%] h-full flex"},dt={class:"w-[50%] h-full ml-[5em] flex items-center"},ut={style:{"letter-spacing":"-0.4px"},class:"text-[19em] font-['SFPRO'] text-black dark:text-white font-[400] text-center leading-[100%] mt-[1px]",delay:100},ht={class:"w-[50%] h-full flex justify-end items-center"},pt={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[1px]"},ft={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[1px]"},mt=["src"],vt={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[3px]"},Ct={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[3px]"},gt={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[3px]"},bt={class:"w-full min-h-[calc(100%-90em)] flex flex-wrap gap-x-[2em] gap-y-[2em] content-start"},wt=["onClick","enter"],kt={key:0,class:"w-[30em] h-[30em] absolute right-0 bottom-0 z-[2] flex items-center justify-center"},xt=["src"],yt=["src"],_t=["src"],St={key:2,class:"w-full h-full relative bg-black"},$t=["src"],Pt={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Mt={class:"w-[35em] h-[35em] rounded-full flex items-center justify-center group-hover:scale-110 transition-transform duration-200"},Ft=["src"],Lt={class:"w-[92px] h-[91px]"},Dt={__name:"Library",props:{deletephotos:{type:Boolean,default:!1},addtocollection:{type:Boolean,default:!1},showcontactlist:{type:Boolean,default:!1},sharephoto:{type:Boolean,default:!1}},emits:["activetabindex","openphoto","deletephotocallback","addtocollectioncallback","sharephotocallback"],setup(V,{emit:E}){const a=ne(),x=ie(),{DarkMode:w}=K(x),{ScrollPage:b}=K(a),{t}=re();ee(()=>{w.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const n=E,k=f("all"),i=V,_=pe(()=>k.value==="all"?b.value.photos.loadedData:k.value==="photos"?b.value.photos.loadedData.filter(l=>!x.isVideo(l.media)):k.value==="videos"?b.value.photos.loadedData.filter(l=>x.isVideo(l.media)):b.value.photos.loadedData),u=f(!1),y=f(null),T=()=>{u.value=!u.value},$=l=>{k.value=l,u.value=!1},h=l=>{y.value&&!y.value.contains(l.target)&&(u.value=!1)},v=f(0),P=f("top"),{sentinel:N,scrollContainer:L,refreshObserver:S}=lt({loadMore:()=>a.LoadPhotosMore(),canLoad:()=>b.value.photos.isInitialized&&b.value.photos.hasMore,isLoading:()=>b.value.photos.isLoading,rootMargin:50,threshold:.5});let p=0;ee(()=>{const l=b.value.photos.loadedData.length;l>p&&p>0&&setTimeout(()=>S(),100),p=l});const j=()=>{if(!L.value)return;const l=L.value,d=l.scrollTop,Z=l.scrollHeight,X=l.clientHeight,D=Z-X;v.value=D>0?d/D:0,d<=5?P.value="top":d>=D-5?P.value="bottom":P.value="middle"};we(()=>{L.value&&L.value.addEventListener("scroll",j),document.addEventListener("click",h)}),me(()=>{L.value&&L.value.removeEventListener("scroll",j),document.removeEventListener("click",h)});const O=f(!1),U=(l,d)=>{O.value?a.SelectedPhotos.includes(l)?a.SelectedPhotos.splice(a.SelectedPhotos.indexOf(l),1):a.pushToSelectedPhotos(l):n("openphoto",{url:l,date:d})},W=l=>a.SelectedPhotos.includes(l),R=()=>{n("deletephotocallback",!1)},Q=()=>B(this,null,function*(){let l=yield q("DELETE_PHOTOS",{photos:a.SelectedPhotos});x.TriggerNotification({appname:"photos",header:t("photos.title"),message:t(l.message)||l.message||t("photos.errors.deleteFailed")}),l.success&&(n("deletephotocallback",!1),a.deletePhoto(a.SelectedPhotos),a.SelectedPhotos=[])}),G=l=>{O.value=!1,n("MoveToAlbum",l)},Y=f(!1),J=l=>{n("SendContactPhotoMessage",l)},C=l=>{n("SharePhotosWithModal",l)};return(l,d)=>{const Z=be("motion-slide-left"),X=be("motion");return s(),c("div",st,[z(ye,{show:i.addtocollection,onClose:d[0]||(d[0]=D=>n("addtocollectioncallback",!1)),onSelectAlbum:G},null,8,["show"]),z(ke,{onCancel:d[1]||(d[1]=D=>n("showcontactlistcallback",!1)),show:i.showcontactlist,onSelectcontact:J},null,8,["show"]),z(xe,{show:i.sharephoto,header:o(t)("photos.sharePhoto"),onPlayerSelected:C,onCancel:d[2]||(d[2]=D=>n("sharephotocallback"))},null,8,["show","header"]),Y.value?(s(),I(ue,{key:0,onBack:d[3]||(d[3]=D=>Y.value=!1),header:o(t)("photos.createNewCollection"),label:o(t)("photos.fillDetailsToCreateCollection"),fields:{name:{placeholder:o(t)("photos.collectionName"),value:""}},buttons:{cancel:o(t)("general.cancel"),submit:o(t)("general.add")}},null,8,["header","label","fields","buttons"])):F("",!0),i.deletephotos?(s(),I(fe,{key:1,onCancel:R,onSubmit:Q,header:o(t)("general.areYouSure"),label:o(t)("photos.confirmDeletePhotosFromLibrary",{count:o(a).SelectedPhotos.length}),buttons:{cancel:o(t)("general.cancel"),submit:o(t)("general.delete")}},null,8,["header","label","buttons"])):F("",!0),e("div",at,[e("div",nt,[e("div",it,[e("div",rt,[e("div",ct,[e("div",dt,[se((s(),c("span",ut,[Le(A(o(a).SelectedPhotos.length>0?o(a).SelectedPhotos.length+" "+o(t)("photos.selected"):o(t)("photos.library")),1)])),[[Z]])]),e("div",ht,[O.value?O.value?(s(),c("div",{key:1,onClick:d[5]||(d[5]=D=>{O.value=!1,o(a).SelectedPhotos=[]}),class:"inline-flex h-[26em] items-center justify-center px-[8em] rounded-full bg-white dark:bg-[#1E1E1E] mr-[5px] cursor-pointer anim-hover-1"},[e("span",ft,A(o(t)("general.done")),1)])):F("",!0):(s(),c("div",{key:0,onClick:d[4]||(d[4]=D=>O.value=!0),class:"inline-flex h-[26em] items-center justify-center px-[8em] rounded-full bg-white dark:bg-[#1E1E1E] mr-[6em] cursor-pointer anim-hover-1"},[e("span",pt,A(o(t)("photos.select")),1)])),O.value?F("",!0):(s(),c("div",{key:2,ref_key:"dropdownRef",ref:y,onClick:T,class:"h-full relative aspect-square rounded-full bg-white dark:bg-[#1E1E1E] shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.10)] flex items-center justify-center cursor-pointer anim-hover-1"},[e("img",{src:o(H)["call/sort.svg"],class:ae(["h-[25%] mr-[1px]",o(w)?"svgwhite":""]),alt:""},null,10,mt),u.value?(s(),c("div",{key:0,onClick:d[9]||(d[9]=Se(()=>{},["stop"])),class:"inline-flex flex-col rounded-[15em] absolute overflow-hidden z-[2] top-0 right-0 bg-white dark:bg-[#1E1E1E] shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.10)]"},[e("div",{onClick:d[6]||(d[6]=D=>$("all")),class:"min-w-[100em] h-[27em] flex items-center justify-center px-[10px] border-b-[1px] border-black/10 cursor-pointer hover:bg-black/5 dark:hover:bg-white/5"},[e("span",vt,A(o(t)("photos.all")),1)]),e("div",{onClick:d[7]||(d[7]=D=>$("photos")),class:"min-w-[100em] h-[27em] flex items-center justify-center px-[10px] border-b-[1px] border-black/10 cursor-pointer hover:bg-black/5 dark:hover:bg-white/5"},[e("span",Ct,A(o(t)("photos.photos")),1)]),e("div",{onClick:d[8]||(d[8]=D=>$("videos")),class:"min-w-[100em] h-[27em] flex items-center justify-center px-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5"},[e("span",gt,A(o(t)("photos.videos")),1)])])):F("",!0)],512))])])])])]),e("div",{class:ae(["w-full h-full bg-[#F2F2F7] dark:bg-black overflow-auto no-scrollbar",[P.value==="top"?"mask-bottom":"",P.value==="middle"?"mask-both":"",P.value==="bottom"?"mask-top":""]]),ref_key:"scrollContainer",ref:L},[d[10]||(d[10]=e("div",{class:"w-full h-[90em] flex items-end justify-center bg-[#F2F2F7] dark:bg-black"},null,-1)),e("div",bt,[(s(!0),c(te,null,oe(_.value,(D,le)=>se((s(),c("div",{onClick:he=>U(D.media,D.date),key:D.media||le,initial:{opacity:0,scale:.85,y:12},enter:{opacity:1,scale:1,y:0,transition:{delay:Math.min(le*50,350),duration:350,ease:"easeOut"}},hovered:{scale:1.05},class:"w-[98em] h-[98em] relative overflow-hidden cursor-pointer group"},[O.value?(s(),c("div",kt,[W(D.media)?(s(),c("img",{key:1,src:o(H)["photos/deletecirclechecked.svg"],class:"h-[90%] aspect-square rounded-full",alt:""},null,8,yt)):(s(),c("img",{key:0,src:o(H)["photos/deletecircle.svg"],class:"h-[60%] aspect-square rounded-full",alt:""},null,8,xt))])):F("",!0),o(x).isVideo(D.media)?(s(),c("div",St,[e("video",{class:"w-full h-full object-cover",src:D.media,preload:"metadata",muted:""},"Your browser does not support the video tag.",8,$t),e("div",Pt,[e("div",Mt,[e("img",{src:o(H)["photos/play.svg"],class:"h-[80%]",alt:""},null,8,Ft)])])])):(s(),c("img",{key:1,src:D.media,class:"w-full anim-hover-1 h-full object-cover",loading:"lazy"},null,8,_t))],8,wt)),[[X]])),128)),(s(),c(te,null,oe(4,D=>e("div",Lt)),64))]),e("div",{ref_key:"sentinel",ref:N,class:"w-full h-[20px]"},null,512)],2)])])}}},Et=de(Dt,[["__scopeId","data-v-764d1599"]]),Tt={class:"notifications-container"},jt={class:"w-full h-full"},At={class:"w-full h-[30em] flex ml-[8em] items-center justify-between mt-[18em]"},Ot={style:{"letter-spacing":"-0.4px"},class:"text-[19em] font-['SFPRO'] text-black dark:text-white font-[400] text-center leading-[100%]"},Bt=["src"],Nt={class:"w-full h-[calc(100%-50em)] p-[2.5em] overflow-auto no-scrollbar"},Ht=["onClick"],Vt={key:0,class:"w-full h-full bg-white dark:bg-white/5 p-[15em] rounded-[15em] cursor-pointer anim-hover-1"},Rt={class:"w-full h-full flex flex-col justify-between items-start"},It={xmlns:"http://www.w3.org/2000/svg",style:{zoom:"0.7"},width:"62",height:"62",viewBox:"0 0 62 62",fill:"none"},Zt=["fill"],zt={style:{"letter-spacing":"-0.4px"},class:"text-[13em] font-['SFPRO'] text-black dark:text-white font-[400] text-center leading-[100%]"},Ut={key:1,class:"w-full h-[133em] relative rounded-[15em] overflow-hidden cursor-pointer anim-hover-1"},Yt=["src"],qt={key:1,class:"w-full h-full"},Wt=["src"],Gt={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Xt={class:"w-[35em] h-[35em] rounded-full flex items-center justify-center group-hover:scale-110 transition-transform duration-200"},Jt=["src"],Kt={class:"w-full h-full absolute top-0 left-0 z-[100] flex items-end",style:{background:"linear-gradient(180deg, transparent 60%, rgba(255, 255, 255, 0.7) 100%)"}},Qt={style:{"letter-spacing":"-0.4px"},class:"text-[13em] font-['SFPRO'] text-black dark:text-white font-[400] text-center leading-[100%] ml-[1em] mb-[1em]"},e1={__name:"Collections",emits:["opencollection"],setup(V,{emit:E}){const a=ie(),{DarkMode:x}=K(a),w=ne(),{ScrollPage:b}=w,{t}=re();ee(()=>{x.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const n=f(!1),k=E,i=$=>B(this,null,function*(){const h=yield q("CREATE_NEW_ALBUM",{name:$.name});h.success?(n.value=!1,w.NewAlbum(h.data)):a.TriggerNotification({appname:"photos",header:t("photos.title"),message:t(h.message)||h.message||t("photos.errors.createAlbumFailed")})}),_=$=>{const h=b.photos.loadedData.filter(N=>N.album_id===$);let v=h.length>0?h[0].media:"",P=a.isVideo(v);return{url:v,isVideo:P}},u=$=>b.photos.loadedData.filter(h=>h.album_id===$).length,y=f("main"),T=$=>{k("opencollection",$)};return($,h)=>(s(),c("div",Tt,[n.value?(s(),I(ue,{key:0,onBack:h[0]||(h[0]=v=>n.value=!1),onAdd:i,header:o(t)("photos.createNewCollection"),label:o(t)("photos.fillDetailsToCreateCollection"),fields:{name:{placeholder:o(t)("photos.collectionName"),value:""}},buttons:{cancel:o(t)("general.cancel"),submit:o(t)("general.add")}},null,8,["header","label","fields","buttons"])):F("",!0),e("div",{class:ae(["main-notifications-page px-[15px] pt-[30em] bg-[#F2F2F7] dark:bg-black",{"slide-right":y.value=="collections"}])},[e("div",jt,[e("div",At,[e("span",Ot,A(o(t)("photos.albums")),1),e("div",{onClick:h[1]||(h[1]=v=>n.value=!0),class:"h-full relative aspect-square mr-[15em] rounded-full bg-white dark:bg-[#1E1E1E] shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.10)] flex items-center justify-center anim-hover-1 cursor-pointer"},[e("img",{src:o(H)["call/+.svg"],class:ae(["h-[30%]"]),alt:""},null,8,Bt)])]),e("div",Nt,[(s(!0),c(te,null,oe(o(b).albums,v=>(s(),c("div",{key:v.id,onClick:P=>T(v.id),class:"w-full h-[146em] p-[7em] mt-[12em] overflow-hidden rounded-[15em]"},[u(v.id)<=0?(s(),c("div",Vt,[e("div",Rt,[(s(),c("svg",It,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M33.4756 0.250001C40.0024 0.249941 42.2065 0.249911 46.2868 0.798461C50.5 1.36492 53.9614 2.56525 56.6986 5.30242C59.4358 8.03959 60.6361 11.501 61.2025 15.7141C61.6942 19.3728 61.7452 25.141 61.7503 31L61.7311 35.5111C61.7053 40.7362 61.5874 44.9617 60.9724 48.3676C60.3454 51.8383 59.1709 54.6517 56.9053 56.9173C54.3307 59.4919 51.0541 60.6529 46.924 61.2082C42.8938 61.75 37.7317 61.75 31.1596 61.75H30.8164C24.2445 61.75 19.0824 61.75 15.0522 61.2082C10.9222 60.6529 7.64549 59.4919 5.07089 56.9173C2.80538 54.6517 1.63088 51.8383 1.004 48.3676C0.388787 44.9617 0.270857 40.7362 0.245117 35.5111L0.251537 30.9997C0.256727 25.1407 0.307517 19.3728 0.799427 15.7141C1.36586 11.501 2.56619 8.03959 5.30336 5.30242C8.04053 2.56525 11.502 1.36492 15.7151 0.798461C19.7955 0.249881 24.9997 0.249941 31.5274 0.250001H33.4756ZM55.2559 16.5136C55.723 19.9868 55.7494 25.8949 55.7509 32.3497C55.7509 32.8465 55.348 33.25 54.8509 33.25H44.7112C40.8706 33.25 38.3047 36.3694 37.0732 38.8369C36.2026 40.5814 34.5118 42.25 30.988 42.25C27.4642 42.25 25.7737 40.5814 24.903 38.8369C23.6715 36.3694 21.1057 33.25 17.2651 33.25H7.15094C6.6539 33.25 6.25091 32.8465 6.25103 32.3497C6.25247 25.8949 6.27896 19.9868 6.74591 16.5136C7.22291 12.9658 8.10944 10.9816 9.54599 9.54505C10.9826 8.1085 12.9668 7.22197 16.5146 6.74497C20.1487 6.25636 26.4487 6.25 33.2509 6.25C40.0531 6.25 41.8531 6.25636 45.4873 6.74497C49.0351 7.22197 51.0193 8.1085 52.456 9.54505C53.8924 10.9816 54.7789 12.9658 55.2559 16.5136Z",fill:o(x)?"#FFFFFFB2":"#000000B2","fill-opacity":"0.7"},null,8,Zt)])),e("span",zt,A(o(t)("photos.emptyCollection")),1)])])):(s(),c("div",Ut,[_(v.id).isVideo?(s(),c("div",qt,[e("video",{class:"w-full h-full object-cover",src:_(v.id).url,preload:"metadata",muted:""},"Your browser does not support the video tag.",8,Wt),e("div",Gt,[e("div",Xt,[e("img",{src:o(H)["photos/play.svg"],class:"h-[80%]",alt:""},null,8,Jt)])])])):(s(),c("img",{key:0,src:_(v.id).url,class:"h-full object-cover w-full object-center absolute top-0",alt:""},null,8,Yt)),e("div",Kt,[e("span",Qt,A(v.name),1)])]))],8,Ht))),128)),h[2]||(h[2]=e("div",{class:"w-full h-[133px]"},null,-1))])])],2)]))}},t1=de(e1,[["__scopeId","data-v-f22aa170"]]),o1={class:"w-full h-full bg-[#F2F2F7] dark:bg-black"},l1={class:"main-photos-page"},s1={class:"w-full h-[90em] flex items-end justify-center absolute top-0 z-[2]"},a1={class:"w-full h-[44em]"},n1={class:"w-full h-[29em] flex justify-center"},i1={class:"w-[91%] h-full flex relative items-center justify-between"},r1={class:"text-[15em] font-['SFPRO'] text-black absolute w-full text-center dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[1px]"},c1=["src"],d1={xmlns:"http://www.w3.org/2000/svg",style:{zoom:"0.7"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},u1={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[3px]"},h1={class:"text-[10em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] whitespace-nowrap mt-[3px]"},p1={class:"text-[10em] font-['SFPRO'] text-[#ED6A6A] font-[400] leading-[100%] whitespace-nowrap mt-[3px]"},f1={class:"w-full h-[calc(100%-90em)] flex flex-wrap gap-x-[2em] gap-y-[2em] content-start"},m1=["onClick"],v1={key:0,class:"w-[30em] h-[30em] absolute right-0 bottom-0 z-[2] flex items-center justify-center"},C1=["src"],g1=["src"],b1=["src"],w1={key:2,class:"w-full h-full relative bg-black"},k1=["src"],x1={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},y1={class:"w-[35em] h-[35em] rounded-full flex items-center justify-center group-hover:scale-110 transition-transform duration-200"},_1=["src"],S1={class:"w-[92px] h-[91px]"},$1={__name:"InCollections",props:{albumid:{type:[String,Number],required:!0},deletephotos:{type:Boolean,default:!1},showcontactlist:{type:Boolean,default:!1},addtocollection:{type:Boolean,default:!1},sharephoto:{type:Boolean,default:!1}},emits:["back","openphoto","deletephotocallback","showcontactlistcallback","addtocollectioncallback","sharephotocallback"],setup(V,{emit:E}){const a=ne(),x=ie(),{DarkMode:w}=K(x),{ScrollPage:b}=K(a),t=E,n=f(!1),k=f(!1),{t:i}=re(),_=V;ee(()=>{w.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const u=pe(()=>b.value.photos.loadedData.filter(C=>C.album_id===_.albumid)),y=pe(()=>{const C=b.value.albums.find(l=>l.id===_.albumid);return C?C.name:i("photos.unknownAlbum")}),T=f(!1),$=f(null),h=()=>{T.value=!T.value},v=C=>{$.value&&!$.value.contains(C.target)&&(T.value=!1)},P=f(null),N=f(0),L=f("top"),S=()=>{if(!P.value)return;const C=P.value,l=C.scrollTop,d=C.scrollHeight,Z=C.clientHeight,X=d-Z;N.value=X>0?l/X:0,l<=5?L.value="top":l>=X-5?L.value="bottom":L.value="middle"};we(()=>{P.value&&(P.value.addEventListener("scroll",S),setTimeout(()=>B(this,null,function*(){yield De(),S()}),100)),document.addEventListener("click",v)}),me(()=>{P.value&&P.value.removeEventListener("scroll",S),document.removeEventListener("click",v)});const p=f(!1);f("main"),f(!1);const j=(C,l)=>{p.value?a.SelectedPhotos.includes(C)?a.SelectedPhotos.splice(a.SelectedPhotos.indexOf(C),1):a.pushToSelectedPhotos(C):t("openphoto",{url:C,date:l})},O=C=>a.SelectedPhotos.includes(C),U=()=>{a.DeletedModal=!1},W=()=>B(this,null,function*(){let C=yield q("DELETE_PHOTOS",{photos:a.SelectedPhotos});x.TriggerNotification({appname:"photos",header:i("photos.title"),message:i(C.message)||C.message||i("photos.errors.deleteFailed")}),C.success&&(t("deletephotocallback",!1),a.deletePhoto(a.SelectedPhotos),a.SelectedPhotos=[])}),R=C=>B(this,null,function*(){let l=yield q("RENAME_ALBUM",{albumid:_.albumid,newname:C.name});n.value=!1,l.success?a.RenameAlbum(_.albumid,C.name):x.TriggerNotification({appname:"photos",header:i("photos.title"),message:i(l.message)||l.message||i("photos.errors.renameFailed")})}),Q=C=>{t("MoveToAlbum",C)},G=C=>{t("SendContactPhotoMessage",C)},Y=C=>{t("SharePhotosWithModal",C)},J=()=>B(this,null,function*(){const C=yield q("DELETE_ALBUM",{albumId:_.albumid});k.value=!1,C.success?(a.DeleteAlbum(_.albumid),x.TriggerNotification({appname:"photos",header:i("photos.title"),message:i("photos.collectionDeleted")||"Collection deleted successfully"}),t("back")):x.TriggerNotification({appname:"photos",header:i("photos.title"),message:i(C.message)||C.message||i("photos.errors.deleteFailed")})});return(C,l)=>(s(),c("div",o1,[z(ke,{onCancel:l[0]||(l[0]=d=>t("showcontactlistcallback",!1)),show:_.showcontactlist,onSelectcontact:G},null,8,["show"]),z(ye,{show:_.addtocollection,onClose:l[1]||(l[1]=d=>t("addtocollectioncallback",!1)),onSelectAlbum:Q},null,8,["show"]),z(xe,{show:_.sharephoto,header:o(i)("photos.sharePhoto"),onPlayerSelected:Y,onCancel:l[2]||(l[2]=d=>t("sharephotocallback"))},null,8,["show","header"]),n.value?(s(),I(ue,{key:0,onBack:l[3]||(l[3]=d=>n.value=!1),onAdd:R,header:o(i)("photos.renameCollection"),label:o(i)("photos.fillDetailsToRenameCollection"),fields:{name:{placeholder:o(i)("photos.collectionName"),value:""}},buttons:{cancel:o(i)("general.cancel"),submit:o(i)("general.rename")}},null,8,["header","label","fields","buttons"])):F("",!0),_.deletephotos?(s(),I(fe,{key:1,onCancel:U,onSubmit:W,header:o(i)("general.areYouSure"),label:o(i)("photos.confirmDeletePhotos",{count:o(a).SelectedPhotos.length}),buttons:{cancel:o(i)("general.cancel"),submit:o(i)("general.delete")}},null,8,["header","label","buttons"])):F("",!0),k.value?(s(),I(fe,{key:2,onCancel:l[4]||(l[4]=d=>k.value=!1),onSubmit:J,header:o(i)("photos.areYouSure"),label:o(i)("photos.confirmDeleteCollection")||"Are you sure you want to delete this collection? All photos will remain in your library.",buttons:{cancel:o(i)("general.cancel"),submit:o(i)("general.delete")}},null,8,["header","label","buttons"])):F("",!0),e("div",l1,[e("div",s1,[e("div",a1,[e("div",n1,[e("div",i1,[e("span",r1,A(y.value),1),e("div",{onClick:l[5]||(l[5]=d=>t("back")),style:{transition:"transform 0.2s ease","transform-origin":"center center","will-change":"transform","box-shadow":"0 0 32.4px 0 rgba(0, 0, 0, 0.1)"},class:"h-full rounded-full aspect-square bg-white dark:bg-[#1E1E1E] flex items-center justify-center anim-hover-1 cursor-pointer"},[e("img",{src:o(H)["settings/leftarrow.svg"],alt:"",class:"h-[32%] rotate-180 bluesvg mr-[2px]"},null,8,c1)]),e("div",{ref_key:"dropdownRef",ref:$,onClick:h,class:"h-full relative aspect-square rounded-full bg-white dark:bg-[#1E1E1E] text-black dark:text-white shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.10)] flex items-center justify-center cursor-pointer anim-hover-1"},[(s(),c("svg",d1,l[10]||(l[10]=[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 12C19 11.7239 19.2239 11.5 19.5 11.5C19.7761 11.5 20 11.7239 20 12C20 12.2761 19.7761 12.5 19.5 12.5C19.2239 12.5 19 12.2761 19 12ZM19.5 9.5C18.1193 9.5 17 10.6193 17 12C17 13.3807 18.1193 14.5 19.5 14.5C20.8807 14.5 22 13.3807 22 12C22 10.6193 20.8807 9.5 19.5 9.5Z",fill:"currentColor"},null,-1),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.5 12C11.5 11.7239 11.7239 11.5 12 11.5C12.2761 11.5 12.5 11.7239 12.5 12C12.5 12.2761 12.2761 12.5 12 12.5C11.7239 12.5 11.5 12.2761 11.5 12ZM12 9.5C10.6193 9.5 9.5 10.6193 9.5 12C9.5 13.3807 10.6193 14.5 12 14.5C13.3807 14.5 14.5 13.3807 14.5 12C14.5 10.6193 13.3807 9.5 12 9.5Z",fill:"currentColor"},null,-1),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 12C4 11.7239 4.2239 11.5 4.5 11.5C4.7761 11.5 5 11.7239 5 12C5 12.2761 4.7761 12.5 4.5 12.5C4.2239 12.5 4 12.2761 4 12ZM4.5 9.5C3.1193 9.5 2 10.6193 2 12C2 13.3807 3.1193 14.5 4.5 14.5C5.8807 14.5 7 13.3807 7 12C7 10.6193 5.8807 9.5 4.5 9.5Z",fill:"currentColor"},null,-1)]))),T.value?(s(),c("div",{key:0,onClick:l[9]||(l[9]=Se(()=>{},["stop"])),class:"inline-flex flex-col rounded-[18em] absolute overflow-hidden z-[2] top-0 right-0 bg-white dark:bg-[#1E1E1E] shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.10)]"},[e("div",{onClick:l[6]||(l[6]=d=>{T.value=!1,p.value=!p.value}),class:"min-w-[100px] h-[27em] flex items-center justify-center p-[15em] border-b-[1px] border-black/10 cursor-pointer hover:bg-black/5 dark:hover:bg-white/5"},[e("span",u1,A(o(i)("photos.selectPhotos")),1)]),e("div",{onClick:l[7]||(l[7]=d=>{T.value=!1,n.value=!0}),class:"min-w-[100px] h-[27em] flex items-center justify-center p-[15em] border-b-[1px] border-black/10 cursor-pointer hover:bg-black/5 dark:hover:bg-white/5"},[e("span",h1,A(o(i)("photos.renameCollection")),1)]),e("div",{onClick:l[8]||(l[8]=d=>{T.value=!1,k.value=!0}),class:"min-w-[100px] h-[27em] flex items-center justify-center p-[17em] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5"},[e("span",p1,A(o(i)("photos.deleteCollection")),1)])])):F("",!0)],512)])])])]),e("div",{class:ae(["w-full h-full bg-[#F2F2F7] dark:bg-black overflow-auto no-scrollbar",[L.value==="top"?"mask-bottom":"",L.value==="middle"?"mask-both":"",L.value==="bottom"?"mask-top":""]]),ref_key:"scrollContainer",ref:P},[l[11]||(l[11]=e("div",{class:"w-full h-[90em] flex items-end justify-center bg-[#F2F2F7] dark:bg-black"},null,-1)),e("div",f1,[(s(!0),c(te,null,oe(u.value,(d,Z)=>(s(),c("div",{onClick:X=>j(d.media,d.date),key:Z,class:"w-[98em] h-[98em] relative overflow-hidden cursor-pointer group"},[p.value?(s(),c("div",v1,[O(d.media)?(s(),c("img",{key:1,src:o(H)["photos/deletecirclechecked.svg"],class:"h-[90%] aspect-square rounded-full",alt:""},null,8,g1)):(s(),c("img",{key:0,src:o(H)["photos/deletecircle.svg"],class:"h-[60%] aspect-square rounded-full",alt:""},null,8,C1))])):F("",!0),o(x).isVideo(d.media)?(s(),c("div",w1,[e("video",{class:"w-full h-full object-cover",src:d.media,preload:"metadata",muted:""},"Your browser does not support the video tag.",8,k1),e("div",x1,[e("div",y1,[e("img",{src:o(H)["photos/play.svg"],class:"h-[80%]",alt:""},null,8,_1)])])])):(s(),c("img",{key:1,src:d.media,class:"w-full anim-hover-1 h-full object-cover",loading:"lazy"},null,8,b1))],8,m1))),128)),(s(),c(te,null,oe(4,d=>e("div",S1)),64))])],2)])]))}},P1=de($1,[["__scopeId","data-v-cf23a109"]]),M1={class:"w-full h-full bg-[#F2F2F7] dark:bg-black relative z-[10]"},F1={class:"w-full h-[87em] flex items-start justify-center"},L1={class:"w-[97%] h-[28em] mt-[41em] flex justify-between"},D1=["src"],E1={key:0,class:"h-full flex items-center"},T1={style:{"letter-spacing":"-0.4px"},class:"text-[12em] font-['SFPRO'] text-black dark:text-white font-[500] leading-[100%] mt-[0.3em]"},j1={key:1,class:"h-full flex items-center"},A1={style:{"letter-spacing":"-0.5px"},class:"text-[11em] font-['SFPRO'] text-black/60 dark:text-white/60 font-[500] leading-[100%] mr-[1em] mt-[0.2em]"},O1={class:"w-full h-[487em] relative overflow-hidden"},B1=["src"],N1={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},H1={class:"w-[35em] h-[35em] rounded-full flex items-center justify-center group-hover:scale-110 transition-transform duration-200"},V1=["src"],R1={key:1,class:"w-full h-full flex items-center justify-center"},I1={key:0,class:"absolute inset-0 flex items-center justify-center"},Z1={key:1,class:"flex flex-col items-center justify-center"},z1={class:"text-gray-500 text-sm"},U1=["src"],Y1={__name:"Viewer",props:{photoData:{type:Object,default:null},deletephotos:{type:Boolean,default:!1},addtocollection:{type:Boolean,default:!1},showcontactlist:{type:Boolean,default:!1},sharephoto:{type:Boolean,default:!1}},emits:["deletephotocallback","back","addtocollectioncallback","showcontactlistcallback","MoveToAlbum","sharephotocallback"],setup(V,{emit:E}){const a=ie(),x=ne(),{t:w}=re(),b=V,t=S=>{if(!S)return{day:"",time:""};const p=new Date(S),j=new Date,O=new Date(j.getFullYear(),j.getMonth(),j.getDate()),U=new Date(O);U.setDate(U.getDate()-1);const W=new Date(p.getFullYear(),p.getMonth(),p.getDate());let R="";if(W.getTime()===O.getTime())R=w("photos.today");else if(W.getTime()===U.getTime())R=w("photos.yesterday");else{const J=p.getDate().toString().padStart(2,"0"),C=(p.getMonth()+1).toString().padStart(2,"0"),l=p.getFullYear();Math.floor((j-p)/(1e3*60*60*24))<7?R=[w("photos.sunday"),w("photos.monday"),w("photos.tuesday"),w("photos.wednesday"),w("photos.thursday"),w("photos.friday"),w("photos.saturday")][p.getDay()]:R=`${J}.${C}.${l}`}const Q=p.getHours().toString().padStart(2,"0"),G=p.getMinutes().toString().padStart(2,"0"),Y=`${Q}:${G}`;return{day:R,time:Y}},n=f(null),k=f(!1),i=f(!1),_=()=>{k.value=!0,i.value=!1},u=()=>{k.value=!1,i.value=!0};me(()=>{n.value&&clearTimeout(n.value)});const y=E,T=()=>{y("back")},$=()=>{y("deletephotocallback",!1)},h=()=>B(this,null,function*(){const S=b.photoData.url;let p=yield q("DELETE_PHOTOS",{photos:[S]});a.TriggerNotification({appname:"photos",header:w("photos.title"),message:w(p.message)||p.message||w("photos.errors.deleteFailed")}),p.success&&(x.deletePhoto([S]),y("deletephotocallback",!1),y("back"))}),v=S=>{y("MoveToAlbum",S)},P=S=>{y("SendContactPhotoMessage",S)},N=S=>{const p=a.isVideo(S);a.setPhotoViewerData({image:S,type:p?"video":"image"})},L=S=>{y("SharePhotosWithModal",S)};return(S,p)=>(s(),c("div",M1,[z(ye,{show:b.addtocollection,onClose:p[0]||(p[0]=j=>y("addtocollectioncallback",!1)),onSelectAlbum:v},null,8,["show"]),z(ke,{onCancel:p[1]||(p[1]=j=>y("showcontactlistcallback",!1)),show:b.showcontactlist,onSelectcontact:P},null,8,["show"]),z(xe,{show:b.sharephoto,header:o(w)("photos.sharePhoto"),onPlayerSelected:L,onCancel:p[2]||(p[2]=j=>y("sharephotocallback"))},null,8,["show","header"]),b.deletephotos?(s(),I(fe,{key:0,onCancel:$,onSubmit:h,header:o(w)("general.areYouSure"),label:o(w)("photos.confirmDeletePhoto"),buttons:{cancel:o(w)("general.cancel"),submit:o(w)("general.delete")}},null,8,["header","label","buttons"])):F("",!0),e("div",F1,[e("div",L1,[e("div",{onClick:T,class:"h-full flex aspect-square rounded-full top-[40em] ml-[13em] bg-white dark:bg-[#1E1E1E] items-center justify-center cursor-pointer anim-hover-1"},[e("img",{src:o(H)["settings/leftarrow.svg"],class:"h-[30%] bluesvg rotate-[180deg] mr-[1em] mt-[.7em]",alt:""},null,8,D1)]),t(b.photoData.date)?(s(),c("div",E1,[e("span",T1,A(t(b.photoData.date).day),1)])):F("",!0),t(b.photoData.date)?(s(),c("div",j1,[e("span",A1,A(t(b.photoData.date).time),1)])):F("",!0)])]),e("div",O1,[o(a).isVideo(b.photoData.url)?(s(),c("div",{key:0,onClick:p[3]||(p[3]=j=>N(b.photoData.url)),class:"w-full h-full relative cursor-pointer anim-hover-1"},[e("video",{class:"w-full h-full object-cover",src:b.photoData.url,preload:"metadata",muted:""},"Your browser does not support the video tag.",8,B1),e("div",N1,[e("div",H1,[e("img",{src:o(H)["photos/play.svg"],class:"h-[80%]",alt:""},null,8,V1)])])])):(s(),c("div",R1,[!k.value&&!i.value?(s(),c("div",I1,p[5]||(p[5]=[e("div",{class:"w-8 h-8 border-2 border-gray-300 border-t-blue-500 rounded-full animate-spin"},null,-1)]))):F("",!0),i.value?(s(),c("div",Z1,[p[6]||(p[6]=e("svg",{class:"w-16 h-16 text-gray-400 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),e("p",z1,A(o(w)("photos.imageLoadError")),1)])):F("",!0),se(e("img",{onClick:p[4]||(p[4]=j=>N(b.photoData.url)),src:b.photoData.url,class:"w-full h-full object-contain scale-[1.26] cursor-pointer anim-hover-1",onLoad:_,onError:u,alt:"Media content"},null,40,U1),[[Ee,k.value]])]))]),p[7]||(p[7]=e("div",{class:"w-full h-[80em]"},null,-1))]))}},q1=de(Y1,[["__scopeId","data-v-50da8339"]]),W1={class:"w-full h-full bg-white rounded-[44em] dark:bg-black overflow-hidden relative"},G1={class:"w-full h-[50em] absolute bottom-[11em] flex items-center z-[12] justify-center"},X1={class:"w-[90%] h-full rounded-full flex justify-between overflow-hidden relative"},J1={class:"absolute inset-0 py-[5em] px-[5em] pointer-events-none"},K1=["onClick"],Q1={key:0,class:"w-full h-full flex flex-col items-center justify-center rounded-full"},eo=["innerHTML"],to=["src"],po={__name:"PhotosApp",setup(V){const E=ne(),{SelectedPhotos:a}=K(E),x=ie(),{DarkMode:w,PhoneData:b}=K(x),{t}=re(),n=f("library");ee(()=>{w.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const k=f(null),i=()=>{k.value=0},_=f([{key:"library"},{key:"collections"},{key:"viewer"},{key:"incollections"}]),u=f(null),y=f([]),T=[{name:"library",get label(){return t("photos.library")},active(){return u.value===null&&a.value.length<=0},click(){S("library")},getSvg(m,r){return``}},{name:"collections",get label(){return t("photos.albums")},active(){return u.value===null&&a.value.length<=0},click(){S("collections")},getSvg(m,r){return``}},{name:"share",get label(){return t("general.share")},active(){return u.value!==null||a.value.length>0},click(){$e()},getSvg(m,r){const M=r?m?"#0d71f0":"#bbbbbb":m?"#0d71f0":"#4d4d4d";return``}},{name:"message",get label(){return t("photos.message")},active(){return u.value!==null||a.value.length>0},click(){X()},getSvg(m,r){const M=r?m?"#0d71f0":"#bbbbbb":m?"#0d71f0":"#4d4d4d";return``}},{name:"add",get label(){return t("general.add")},active(){return u.value!==null||a.value.length>0},click(){C()},getSvg(m,r){const M=r?m?"#0d71f0":"#bbbbbb":m?"#0d71f0":"#4d4d4d";return``}}];we(()=>B(this,null,function*(){E.fetchPhotos()}));const $=pe(()=>T.filter(m=>m.active())),h=f(!1),v=f(!1),P=m=>B(this,null,function*(){if(v.value)return;v.value=!0;const r=m.name;let M=yield je(r);if(!M.success){x.TriggerNotification({appname:"photos",header:t("photos.title"),message:t(M.message)}),h.value=!1,v.value=!1;return}let g=yield q("UPLOAD_PHOTO",{url:M.fileInfo.url,size:Number(M.fileInfo.size)});g&&g.success?(E.UploadPhoto(g.data),h.value=!1,v.value=!1):(x.TriggerNotification({appname:"photos",header:t("photos.title"),message:t("photos.invalidUrl")}),h.value=!1,v.value=!1)}),N=(m,r=null)=>{y.value.push({page:n.value,openPhotoData:u.value,selectedAlbumId:j.value}),r&&(m==="viewer"&&(u.value=r),m==="incollections"&&(j.value=r)),n.value=m},L=m=>{N("viewer",m)},S=m=>{(m==="library"||m==="collections")&&(y.value=[],u.value=null,j.value=null),n.value=m},p=()=>{if(y.value.length>0){const m=y.value.pop();n.value=m.page,n.value==="library"&&(k.value=0),u.value=m.openPhotoData,j.value=m.selectedAlbumId}else u.value=null,j.value=null,k.value=0,S("library")},j=f(null),O=m=>{N("incollections",m)},U=f(!1),W=f(!1),R=f(!1),Q=()=>{n.value=="library"?U.value=!0:n.value=="incollections"?W.value=!0:n.value=="viewer"&&u.value&&(R.value=!0)},G=f(!1),Y=f(!1),J=f(!1),C=()=>{n.value=="library"&&(G.value=!0),n.value=="viewer"&&u.value&&(Y.value=!0),n.value=="incollections"&&(J.value=!0)},l=f(!1),d=f(!1),Z=f(!1),X=()=>{if(n.value=="library"){d.value=!0;return}if(n.value=="incollections"){Z.value=!0;return}l.value=!0},D=m=>B(this,null,function*(){let r=yield q("MOVE_PHOTOS_TO_ALBUM",{photos:u.value?[u.value.url]:E.SelectedPhotos,albumId:m});r.success?(E.MoveToAlbum(u.value?[u.value.url]:E.SelectedPhotos,m),Y.value=!1,G.value=!1,E.SelectedPhotos=[]):x.TriggerNotification({appname:"photos",header:t("photos.title"),message:t(r.message)||r.message||t("photos.errors.moveFailed")})}),le=m=>B(this,null,function*(){d.value=!1,l.value=!1;const r=u.value?[u.value.url]:E.SelectedPhotos;if(r.length===0){x.TriggerNotification({appname:"message",header:t("photos.title"),message:t("photos.noPhotosSelected")});return}for(const M of r){let g=yield q("SEND_MESSAGE",{recipients:[{target_phone:m.target_phone}],message:{type:"media",content:M}});if(!g.success){console.error("Failed to share photo"),x.TriggerNotification({appname:"message",header:t("photos.title"),message:t(g.message)||g.message||t("photos.errors.shareFailed")});return}}x.TriggerNotification({appname:"message",header:t("photos.title"),message:t("photos.sharedSuccessfully")}),E.SelectedPhotos=[]}),he=f(!1),ve=f(!1),Ce=f(!1),$e=()=>{n.value=="library"&&(he.value=!0),n.value=="viewer"&&u.value&&(ve.value=!0),n.value=="incollections"&&(Ce.value=!0)},ge=m=>B(this,null,function*(){let r=[];u.value?r=[u.value.url]:r=E.SelectedPhotos;let M=yield q("SHARE_PHOTO_FROM_MODAL",{photos:r,target:m.playerId,playerName:b.value.settings.name});if(!M.success){x.TriggerNotification({appname:"photos",header:t("photos.title"),message:t(M.message)||M.message||t("photos.errors.shareFailed")});return}});return(m,r)=>{const M=be("motion");return s(),c("div",W1,[h.value?(s(),I(ue,{key:0,onBack:r[0]||(r[0]=g=>h.value=!1),onAdd:P,header:o(t)("photos.addPhotoFromUrl"),label:o(t)("photos.addPhotoUrlLabel"),fields:{name:{placeholder:o(t)("photos.pasteUrl"),value:"",maxLength:500}},buttons:{cancel:o(t)("general.cancel"),submit:o(t)("general.add")}},null,8,["header","label","fields","buttons"])):F("",!0),z(Te,{"current-key":n.value,items:_.value,duration:300,easing:"ease-in-out"},{library:ce(()=>[z(Et,{onActivetabindex:i,onOpenphoto:L,addtocollection:G.value,onAddtocollectioncallback:r[1]||(r[1]=g=>G.value=g),deletephotos:U.value,onDeletephotocallback:r[2]||(r[2]=g=>U.value=g),showcontactlist:d.value,onShowcontactlistcallback:r[3]||(r[3]=g=>d.value=g),onMoveToAlbum:D,onSendContactPhotoMessage:le,sharephoto:he.value,onSharephotocallback:r[4]||(r[4]=g=>he.value=g),onSharePhotosWithModal:ge},null,8,["addtocollection","deletephotos","showcontactlist","sharephoto"])]),collections:ce(()=>[n.value==="collections"?(s(),I(t1,{key:0,onOpencollection:O})):F("",!0)]),viewer:ce(()=>[n.value==="viewer"&&u.value?(s(),I(q1,{key:0,photoData:u.value,onBack:p,deletephotos:R.value,onDeletephotocallback:r[5]||(r[5]=g=>R.value=g),addtocollection:Y.value,onAddtocollectioncallback:r[6]||(r[6]=g=>Y.value=g),showcontactlist:l.value,onShowcontactlistcallback:r[7]||(r[7]=g=>l.value=g),onMoveToAlbum:D,onSendContactPhotoMessage:le,sharephoto:ve.value,onSharephotocallback:r[8]||(r[8]=g=>ve.value=g),onSharePhotosWithModal:ge},null,8,["photoData","deletephotos","addtocollection","showcontactlist","sharephoto"])):F("",!0)]),incollections:ce(()=>[n.value==="incollections"?(s(),I(P1,{key:0,onOpenphoto:L,albumid:j.value,onBack:p,deletephotos:W.value,onDeletephotocallback:r[9]||(r[9]=g=>W.value=g),showcontactlist:Z.value,onShowcontactlistcallback:r[10]||(r[10]=g=>Z.value=g),onSendContactPhotoMessage:le,addtocollection:J.value,onAddtocollectioncallback:r[11]||(r[11]=g=>J.value=g),onMoveToAlbum:D,sharephoto:Ce.value,onSharephotocallback:r[12]||(r[12]=g=>Ce.value=g),onSharePhotosWithModal:ge},null,8,["albumid","deletephotos","showcontactlist","addtocollection","sharephoto"])):F("",!0)]),_:1},8,["current-key","items"]),e("div",G1,[e("div",X1,[se((s(),c("div",{class:"h-full rounded-full bg-white dark:bg-[#1E1E1E] grid transition-all duration-300 relative",style:_e(`grid-template-columns: repeat(${$.value.length}, 65em)`),initial:{opacity:0},enter:{opacity:1,transition:{delay:100,duration:300}}},[e("div",J1,[e("div",{class:"h-full bg-black/5 dark:bg-white/5 rounded-full transition-transform duration-250 ease-in-out",style:_e(u.value==null&&o(a).length<=0?{width:"55em",transform:`translateX(${k.value*65}em)`}:{width:"0px",transform:"translateX(0px)"})},null,4)]),(s(!0),c(te,null,oe($.value,(g,Pe)=>(s(),c("div",{onClick:oo=>(g.click(),k.value=Pe),key:g.name,class:"h-full py-[8em] cursor-pointer relative z-10"},[g.active()?(s(),c("div",Q1,[e("div",{class:"h-[50%]",innerHTML:g.getSvg(n.value===g.name,o(w))},null,8,eo),e("p",{class:ae([n.value==g.name?"!text-[#2e85f7]":"","text-[7.5em] font-['SFPRO'] text-black/70 dark:text-white/70 font-[400] leading-[100%] mt-[0.6em] truncate w-full text-center max-w-[80%]"])},A(g.label),3)])):F("",!0)],8,K1))),128))],4)),[[M]]),o(a).length<=0&&n.value==="library"?se((s(),c("div",{key:0,onClick:r[13]||(r[13]=g=>h.value=!0),class:"h-full rounded-full bg-white w-[50em] dark:bg-[#1E1E1E] flex items-center justify-center dark:hover:bg-white/10 cursor-pointer transition-all duration-300 ease-out absolute right-0",initial:{opacity:0},enter:{opacity:1,transition:{delay:200,duration:300}}},r[14]||(r[14]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[30%]",viewBox:"0 0 22 22",fill:"none"},[e("path",{d:"M11 21.6673C10.3739 21.6673 9.87646 21.4772 9.50756 21.0971C9.13843 20.7169 8.95387 20.225 8.95387 19.6212V13.0468H2.37963C1.77578 13.0468 1.2838 12.8623 0.90368 12.4933C0.52356 12.1243 0.333496 11.6268 0.333496 11.0006C0.333496 10.3745 0.52356 9.87696 0.90368 9.50799C1.2838 9.139 1.77578 8.95451 2.37963 8.95451H8.95387V2.38009C8.95387 1.77633 9.13843 1.28436 9.50756 0.904196C9.87646 0.524055 10.3739 0.333984 11 0.333984C11.6263 0.333984 12.1239 0.524055 12.4928 0.904196C12.8617 1.28436 13.0461 1.77633 13.0461 2.38009V8.95451H19.6207C20.2245 8.95451 20.7165 9.139 21.0966 9.50799C21.4768 9.87696 21.6668 10.3745 21.6668 11.0006C21.6668 11.6268 21.4768 12.1243 21.0966 12.4933C20.7165 12.8623 20.2245 13.0468 19.6207 13.0468H13.0461V19.6212C13.0461 20.225 12.8617 20.7169 12.4928 21.0971C12.1239 21.4772 11.6263 21.6673 11 21.6673Z",fill:"#0D71F0"})],-1)]))),[[M]]):F("",!0),o(a).length>0||n.value==="viewer"?se((s(),c("div",{key:1,onClick:Q,class:"h-full rounded-full bg-white w-[50em] dark:bg-[#1E1E1E] flex items-center justify-center cursor-pointer transition-all duration-300 ease-out absolute right-0",initial:{opacity:0},enter:{opacity:1,transition:{delay:200,duration:300}}},[e("img",{src:o(H)["call/delete.svg"],class:"h-[30%]",alt:""},null,8,to)])),[[M]]):F("",!0)])])])}}};export{po as default};