27 lines
60 KiB
JavaScript
27 lines
60 KiB
JavaScript
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`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" fill="none" style=" height: 80%;">
|
|
<path
|
|
fill-rule="evenodd"
|
|
clip-rule="evenodd"
|
|
d="M11.0652 0.75C13.0744 0.74998 14.6717 0.74997 15.934 0.90331C17.2327 1.06106 18.3071 1.39345 19.1968 2.15334C19.4301 2.35261 19.6474 2.56991 19.8467 2.80323C20.6065 3.69294 20.9389 4.76729 21.0967 6.06598C21.25 7.32829 21.25 9.0561 21.25 11.0653C21.25 13.0744 21.25 14.6717 21.0967 15.934C20.9389 17.2327 20.6065 18.3071 19.8467 19.1968C19.6474 19.4301 19.4301 19.6474 19.1968 19.8467C18.3071 20.6065 17.2327 20.9389 15.934 21.0967C14.6717 21.25 12.9439 21.25 10.9347 21.25C8.92558 21.25 7.32829 21.25 6.06598 21.0967C4.76729 20.9389 3.69294 20.6065 2.80323 19.8467C2.56991 19.6474 2.35261 19.4301 2.15334 19.1968C1.39345 18.3071 1.06106 17.2327 0.90331 15.934C0.74997 14.6717 0.74998 13.0744 0.75 11.0652C0.74998 9.0561 0.74997 7.3283 0.90331 6.06598C1.06106 4.76729 1.39345 3.69294 2.15334 2.80323C2.35261 2.56991 2.56991 2.35261 2.80323 2.15334C3.69294 1.39345 4.76729 1.06106 6.06598 0.90331C7.3283 0.74997 9.0561 0.74998 11.0652 0.75ZM2.84153 15.6986C2.97614 16.8067 3.22847 17.4493 3.63803 17.9288C3.77088 18.0843 3.91575 18.2292 4.0713 18.3621C4.55084 18.7716 5.19337 19.024 6.3015 19.1586C7.43237 19.2959 8.91094 19.2976 11.0001 19.2976C13.0892 19.2976 14.5678 19.2959 15.6987 19.1586C16.8068 19.024 17.4493 18.7716 17.9289 18.3621C18.0844 18.2292 18.2293 18.0843 18.3622 17.9288C18.7717 17.4493 19.024 16.8067 19.1587 15.6986C19.2103 15.2738 19.2427 14.7999 19.2631 14.263L17.5304 12.5303C17.1909 12.1908 16.7303 12 16.2501 12C15.7699 12 15.3093 12.1908 14.9698 12.5303L13.0001 14.5L9.0304 10.5303C8.69086 10.1908 8.23031 10 7.75009 10C7.26988 10 6.80933 10.1908 6.46976 10.5303L2.73706 14.263C2.75747 14.7999 2.78993 15.2738 2.84153 15.6986ZM14.5 5.25C13.8096 5.25 13.25 5.80964 13.25 6.5C13.25 7.19036 13.8096 7.75 14.5 7.75C15.1904 7.75 15.75 7.19036 15.75 6.5C15.75 5.80964 15.1904 5.25 14.5 5.25Z"
|
|
" fill="${r?m?"#0d71f0":"#bbbbbb":m?"#0d71f0":"#4d4d4d"}"
|
|
/>
|
|
</svg>`}},{name:"collections",get label(){return t("photos.albums")},active(){return u.value===null&&a.value.length<=0},click(){S("collections")},getSvg(m,r){return`<svg xmlns="http://www.w3.org/2000/svg" style=" height: 80%;" viewBox="0 0 22 22" fill="none">
|
|
<path
|
|
fill-rule="evenodd"
|
|
clip-rule="evenodd"
|
|
d="M11.8251 0.75C14.0007 0.74998 14.7354 0.74997 16.0955 0.93282C17.4999 1.12164 18.6537 1.52175 19.5661 2.43414C20.4785 3.34653 20.8786 4.50033 21.0674 5.90471C21.2313 7.12428 21.2483 9.047 21.25 11L21.2436 12.5037C21.235 14.2454 21.1957 15.6539 20.9907 16.7892C20.7817 17.9461 20.3902 18.8839 19.635 19.6391C18.7768 20.4973 17.6846 20.8843 16.3079 21.0694C14.9645 21.25 13.2438 21.25 11.0531 21.25H10.9387C8.74807 21.25 7.0274 21.25 5.68399 21.0694C4.30733 20.8843 3.21508 20.4973 2.35688 19.6391C1.60171 18.8839 1.21021 17.9461 1.00125 16.7892C0.796181 15.6539 0.756871 14.2454 0.748291 12.5037L0.750431 10.9999C0.752161 9.0469 0.769091 7.12426 0.933061 5.90471C1.12187 4.50033 1.52198 3.34653 2.43437 2.43414C3.34676 1.52175 4.50057 1.12164 5.90495 0.93282C7.26508 0.74996 8.99981 0.74998 11.1757 0.75H11.8251ZM19.0852 6.17121C19.2409 7.32894 19.2497 9.2983 19.2502 11.4499C19.2502 11.6155 19.1159 11.75 18.9502 11.75H15.5703C14.2901 11.75 13.4348 12.7898 13.0243 13.6123C12.7341 14.1938 12.1705 14.75 10.9959 14.75C9.82133 14.75 9.25783 14.1938 8.96758 13.6123C8.55709 12.7898 7.70181 11.75 6.42162 11.75H3.05023C2.88455 11.75 2.75022 11.6155 2.75026 11.4499C2.75074 9.2983 2.75957 7.32894 2.91522 6.17121C3.07422 4.9886 3.36973 4.3272 3.84858 3.84835C4.32744 3.3695 4.98884 3.07399 6.17144 2.91499C7.38281 2.75212 9.48283 2.75 11.7502 2.75C14.0176 2.75 14.6176 2.75212 15.829 2.91499C17.0116 3.07399 17.673 3.3695 18.1519 3.84835C18.6307 4.3272 18.9262 4.9886 19.0852 6.17121Z"
|
|
fill="${r?m?"#0d71f0":"#bbbbbb":m?"#0d71f0":"#4d4d4d"}"
|
|
/>
|
|
</svg>`}},{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`<svg xmlns="http://www.w3.org/2000/svg" style=" height: 80%;" viewBox="0 0 24 24" fill="none">
|
|
<circle cx="12" cy="12" r="2" fill="${M}" />
|
|
<path d="M9.80322 15.7347C8.97599 15.2482 8.33364 14.5009 7.97694 13.61C7.62025 12.7191 7.56939 11.7349 7.83235 10.812C8.09531 9.88905 8.6572 9.0795 9.42988 8.51035C10.2026 7.9412 11.1423 7.64465 12.1017 7.66721C13.0611 7.68978 13.9859 8.03018 14.731 8.63503C15.476 9.23987 15.9993 10.0749 16.2185 11.0092C16.4378 11.9435 16.3407 12.9241 15.9426 13.7973C15.5444 14.6705 14.8676 15.3868 14.0184 15.8338" stroke="${M}" stroke-opacity="0.7" stroke-width="2" stroke-linecap="round"/>
|
|
<path d="M8.11384 18.6093C6.65027 17.7486 5.51381 16.4265 4.88274 14.8502C4.25167 13.274 4.16169 11.5328 4.62691 9.89994C5.09214 8.26704 6.08626 6.83477 7.45331 5.82781C8.82037 4.82086 10.483 4.29618 12.1804 4.3361C13.8778 4.37602 15.514 4.97828 16.8322 6.04839C18.1504 7.1185 19.0761 8.59592 19.464 10.2489C19.852 11.9018 19.6802 13.6368 18.9758 15.1817C18.2713 16.7265 17.0739 17.9938 15.5715 18.7847" stroke="${M}" stroke-opacity="0.7" stroke-width="2" stroke-linecap="round"/>
|
|
<path d="M6.42397 21.482C4.32407 20.2471 2.69349 18.3501 1.78804 16.0885C0.88259 13.8269 0.753489 11.3288 1.42099 8.98593C2.0885 6.64308 3.51484 4.58808 5.47626 3.14332C7.43768 1.69855 9.82322 0.945764 12.2586 1.00304C14.694 1.06032 17.0416 1.92442 18.9329 3.4598C20.8242 4.99517 22.1524 7.11495 22.709 9.48659C23.2656 11.8582 23.0192 14.3476 22.0085 16.5641C20.9977 18.7806 19.2797 20.5988 17.1241 21.7336" stroke="${M}" stroke-opacity="0.7" stroke-width="2" stroke-linecap="round"/>
|
|
</svg>`}},{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`<svg xmlns="http://www.w3.org/2000/svg" style=" height: 80%;" viewBox="0 0 22 20" fill="none">
|
|
<path d="M4.20988 20C4.64316 20 5.20254 19.8727 5.88801 19.6182C6.5735 19.3635 7.29455 19.0326 8.05116 18.6253C8.80778 18.2179 9.51267 17.782 10.1658 17.3174C11.5174 17.3556 12.7913 17.241 13.9876 16.9738C15.184 16.7064 16.2721 16.3134 17.2518 15.7947C18.2316 15.276 19.0755 14.6539 19.7836 13.9283C20.4916 13.2029 21.0381 12.3962 21.4229 11.5084C21.8076 10.6206 22 9.67703 22 8.6778C22 7.47493 21.7171 6.34844 21.1512 5.29832C20.5854 4.2482 19.7997 3.32696 18.7941 2.5346C17.7885 1.74224 16.6196 1.12172 15.2875 0.673031C13.9553 0.224344 12.5262 0 11 0C9.47385 0 8.04469 0.224344 6.71253 0.673031C5.38037 1.12172 4.2115 1.74224 3.20591 2.5346C2.20032 3.32696 1.41461 4.2482 0.848767 5.29832C0.282922 6.34844 0 7.47493 0 8.6778C0 9.72154 0.211787 10.7112 0.635362 11.6468C1.05894 12.5823 1.65388 13.4224 2.42019 14.1671C3.18651 14.9117 4.08055 15.5163 5.1023 15.9809C4.95357 16.2609 4.77573 16.56 4.56879 16.8782C4.36185 17.1965 4.15492 17.5004 3.94798 17.7899C3.74104 18.0795 3.5632 18.3166 3.41447 18.5012C3.24633 18.724 3.16549 18.9515 3.17196 19.1837C3.17843 19.4161 3.26896 19.6102 3.44357 19.7661C3.61817 19.922 3.87361 20 4.20988 20ZM5.2284 18.4153C5.1896 18.428 5.16374 18.4232 5.15081 18.4009C5.13787 18.3787 5.14434 18.3516 5.1702 18.3198C5.44181 17.9888 5.74251 17.6054 6.07232 17.1695C6.40213 16.7335 6.6511 16.3627 6.81923 16.0573C6.95504 15.8091 6.99707 15.5799 6.94534 15.37C6.8936 15.1599 6.71253 14.9817 6.40213 14.8353C5.38684 14.3707 4.52191 13.8218 3.80733 13.1885C3.09275 12.5553 2.54792 11.8568 2.17284 11.0931C1.79777 10.3294 1.61023 9.52427 1.61023 8.6778C1.61023 7.69769 1.85112 6.77963 2.33289 5.92362C2.81467 5.06762 3.48399 4.31344 4.34084 3.6611C5.19769 3.00875 6.19519 2.49801 7.33334 2.12887C8.4715 1.75974 9.69372 1.57518 11 1.57518C12.3063 1.57518 13.5285 1.75974 14.6667 2.12887C15.8049 2.49801 16.8024 3.00875 17.6592 3.6611C18.5161 4.31344 19.187 5.06762 19.672 5.92362C20.157 6.77963 20.3995 7.69769 20.3995 8.6778C20.3995 9.65155 20.157 10.568 19.672 11.4272C19.187 12.2864 18.5161 13.0406 17.6592 13.6897C16.8024 14.3389 15.8049 14.848 14.6667 15.2172C13.5285 15.5863 12.3063 15.7709 11 15.7709C10.903 15.7709 10.7801 15.7693 10.6314 15.7661C10.4827 15.7629 10.3113 15.7581 10.1173 15.7518C9.91681 15.7518 9.73091 15.7852 9.55954 15.852C9.38817 15.9189 9.21195 16.0223 9.03088 16.1623C8.6364 16.4423 8.19989 16.7335 7.72136 17.0358C7.24281 17.3381 6.78043 17.6133 6.33422 17.8616C5.88801 18.1097 5.51941 18.2943 5.2284 18.4153Z" fill="${M}"/>
|
|
<path d="M5.2284 18.4153C5.1896 18.428 5.16374 18.4232 5.15081 18.4009C5.13787 18.3787 5.14434 18.3516 5.1702 18.3198C5.44181 17.9888 5.74251 17.6054 6.07232 17.1695C6.40213 16.7335 6.6511 16.3627 6.81923 16.0573C6.95504 15.8091 6.99707 15.5799 6.94534 15.37C6.8936 15.1599 6.71253 14.9817 6.40213 14.8353C5.38684 14.3707 4.52191 13.8218 3.80733 13.1885C3.09275 12.5553 2.54792 11.8568 2.17284 11.0931C1.79777 10.3294 1.61023 9.52427 1.61023 8.6778C1.61023 7.69769 1.85112 6.77963 2.33289 5.92362C2.81467 5.06762 3.48399 4.31344 4.34084 3.6611C5.19769 3.00875 6.19519 2.49801 7.33334 2.12887C8.4715 1.75974 9.69372 1.57518 11 1.57518C12.3063 1.57518 13.5285 1.75974 14.6667 2.12887C15.8049 2.49801 16.8024 3.00875 17.6592 3.6611C18.5161 4.31344 19.187 5.06762 19.672 5.92362C20.157 6.77963 20.3995 7.69769 20.3995 8.6778C20.3995 9.65155 20.157 10.568 19.672 11.4272C19.187 12.2864 18.5161 13.0406 17.6592 13.6897C16.8024 14.3389 15.8049 14.848 14.6667 15.2172C13.5285 15.5863 12.3063 15.7709 11 15.7709C10.903 15.7709 10.7801 15.7693 10.6314 15.7661C10.4827 15.7629 10.3113 15.7581 10.1173 15.7518C9.91681 15.7518 9.73091 15.7852 9.55954 15.852C9.38817 15.9189 9.21195 16.0223 9.03088 16.1623C8.6364 16.4423 8.19989 16.7335 7.72136 17.0358C7.24281 17.3381 6.78043 17.6133 6.33422 17.8616C5.88801 18.1097 5.51941 18.2943 5.2284 18.4153Z" fill="${M}"/>
|
|
</svg>`}},{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`<svg xmlns="http://www.w3.org/2000/svg" style="height: 80%" viewBox="0 0 24 24" fill="none">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 1.25C15.3766 1.25 13.25 3.37665 13.25 6C13.25 8.62335 15.3766 10.75 18 10.75C20.6234 10.75 22.75 8.62335 22.75 6C22.75 3.37665 20.6234 1.25 18 1.25ZM19.6884 5.3285C20.0531 5.13216 20.1896 4.67733 19.9932 4.31261C19.7969 3.94788 19.3421 3.81138 18.9773 4.00773C18.3195 4.36188 17.7563 5.10818 17.4255 5.60905C17.3158 5.5213 17.1106 5.38248 16.9891 5.32453C16.6153 5.14618 16.1676 5.30467 15.9893 5.67852C15.8126 6.04892 15.9665 6.49177 16.333 6.67337C16.333 6.67337 16.4367 6.73845 16.4958 6.78627C16.6141 6.88211 16.7719 7.0386 16.9089 7.27106C17.0496 7.5098 17.3104 7.65153 17.5872 7.63965C17.864 7.62777 18.1118 7.4641 18.2315 7.21431C18.2528 7.17242 18.3142 7.05185 18.3561 6.97497C18.4404 6.82046 18.5616 6.61018 18.7093 6.38669C19.0269 5.90582 19.3849 5.49185 19.6884 5.3285Z" fill="${M}"/>
|
|
<path d="M20.1793 11.8596C19.9654 11.9391 19.8585 11.9789 19.8048 12.0562C19.7512 12.1335 19.7513 12.24 19.7516 12.453C19.7518 12.6174 19.7519 12.7831 19.7519 12.9499C19.752 13.1155 19.6176 13.25 19.4519 13.25H16.072C14.7918 13.25 13.9366 14.2898 13.5261 15.1123C13.2358 15.6938 12.6723 16.25 11.4977 16.25C10.3231 16.25 9.7595 15.6938 9.46929 15.1123C9.05879 14.2898 8.20352 13.25 6.92333 13.25H3.55194C3.38626 13.25 3.25193 13.1155 3.25197 12.9499C3.25245 10.7983 3.26128 8.82894 3.41693 7.67121C3.57593 6.4886 3.87144 5.8272 4.35029 5.34835C4.82915 4.8695 5.49055 4.57399 6.67315 4.41499C7.75804 4.26913 9.55567 4.2522 11.548 4.25025C11.7604 4.25004 11.8666 4.24994 11.9437 4.19628C12.0208 4.14261 12.0604 4.03598 12.1397 3.82272C12.2094 3.63521 12.2878 3.45194 12.3745 3.27343C12.6146 2.77898 12.7347 2.53175 12.6465 2.39096C12.5584 2.25016 12.3051 2.25012 11.7986 2.25002L11.6775 2.25C9.50152 2.24998 7.76678 2.24996 6.40666 2.43283C5.00228 2.62164 3.84847 3.02175 2.93608 3.93414C2.02369 4.84653 1.62358 6.00033 1.43477 7.40471C1.2708 8.62426 1.25387 10.5469 1.25214 12.4999L1.25 14.0037C1.25858 15.7454 1.29789 17.1539 1.50296 18.2892C1.71192 19.4461 2.10342 20.3839 2.85859 21.1391C3.71679 21.9973 4.80904 22.3843 6.1857 22.5694C7.52911 22.75 9.24978 22.75 11.4405 22.75H11.5548C13.7455 22.75 15.4662 22.75 16.8097 22.5694C18.1863 22.3843 19.2786 21.9973 20.1368 21.1391C20.8919 20.3839 21.2834 19.4461 21.4924 18.2892C21.6975 17.1539 21.7368 15.7454 21.7453 14.0037L21.7517 12.5C21.7517 12.3963 21.7515 12.2927 21.7513 12.1893C21.7504 11.6896 21.7499 11.4398 21.609 11.3519C21.468 11.264 21.2238 11.3831 20.7353 11.6212C20.5547 11.7093 20.3691 11.7889 20.1793 11.8596Z" fill="${M}"/>
|
|
</svg>`}}];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};
|