2 lines
39 KiB
JavaScript
2 lines
39 KiB
JavaScript
var ve=Object.defineProperty,we=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ne=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var ie=(c,a,l)=>a in c?ve(c,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[a]=l,G=(c,a)=>{for(var l in a||(a={}))_e.call(a,l)&&ie(c,l,a[l]);if(ne)for(var l of ne(a))Ce.call(a,l)&&ie(c,l,a[l]);return c},ae=(c,a)=>we(c,pe(a));var F=(c,a,l)=>new Promise((f,r)=>{var g=u=>{try{b(l.next(u))}catch($){r($)}},m=u=>{try{b(l.throw(u))}catch($){r($)}},b=u=>u.done?f(u.value):Promise.resolve(u.value).then(g,m);b((l=l.apply(c,a)).next())});import{r as k,b as U,w as re,V as E,f as i,g as R,h as o,v as Z,A as x,i as e,W as ge,t as y,k as n,J as X,x as B,F as z,m as Y,q as W,Q as ce,U as ue,G as ye,d as xe,j as ee,s as de,o as te,l as fe,e as be}from"./vendor-vue.CmaRnji1.js";import{a as J,u as Q,i as he,f as H,_ as ke,A as Ne}from"./index.CjrDwa0W.js";import"./vendor.DSdF8huI.js";import{i as me,P as $e}from"./swiper.tg5sgs8j.js";import{U as Pe}from"./UploadPhoto.DgxGHiME.js";import{C as Se}from"./CrossFade.B9Ap6pL9.js";import"./UploadPhoto.Bqd-ApD8.js";const Le={key:0,class:"w-full h-full bg-[#FFF2C7] flex flex-col"},Ae={class:"w-full h-[92em] flex items-end justify-center shrink-0",delay:50},Me={class:"w-[90%] h-[50%]"},Fe={class:"w-full h-[71%] flex justify-between items-center"},Ee={class:"text-[14em] font-['SFPRO']",delay:150},Te={class:"w-full h-[50em] flex items-center justify-center shrink-0",delay:250},Re=["placeholder"],Oe={class:"w-full h-[450em] flex flex-col items-center overflow-auto no-scrollbar px-[14em]",delay:300},De=["placeholder"],je={key:0,class:"w-full px-[14em] py-[10em] shrink-0"},Ve=["delay"],He=["src"],Be=["src"],Ze={key:2,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Ie={class:"w-[28em] h-[28em] rounded-full flex items-center justify-center"},We=["src"],Ue=["onClick"],qe={class:"text-[12em] font-['SFPRO'] ml-[0.5em]"},le={__name:"CreateNews",props:{show:{type:Boolean,required:!0},editData:{type:Object,default:null}},emits:["back","publish"],setup(c,{emit:a}){const{t:l}=J(),f=Q(),r=a,g=c,m=k(""),b=k(""),u=k([]),$=[me],p=k(!1),_=U(()=>g.editData!==null);re(()=>g.editData,C=>{C?(m.value=C.title||"",b.value=C.content||"",u.value=C.media?[...C.media]:[]):(m.value="",b.value="",u.value=[])},{immediate:!0}),re(()=>g.show,C=>{C||(m.value="",b.value="",u.value=[])});function S(){m.value="",b.value="",u.value=[],r("back")}const T=C=>{console.log("Selected photo:",C),u.value.push(...C),p.value=!1},D=C=>{u.value.splice(C,1)},V=()=>{if(!m.value||m.value.trim()===""||!b.value||b.value.trim()==="")return;const C={title:m.value.trim(),content:b.value.trim(),media:u.value};_.value?r("publish",ae(G({},C),{id:g.editData.id})):r("publish",C)};return(C,N)=>{const O=E("motion-fade"),I=E("motion-slide-top"),M=E("motion-slide-left"),d=E("motion-pop"),j=E("motion-slide-bottom");return c.show?(o(),i("div",Le,[Z(Pe,{show:p.value,onSelectPhoto:T,multiselect:!0,onCancel:N[0]||(N[0]=L=>p.value=!1)},null,8,["show"]),x((o(),i("div",Ae,[e("div",Me,[e("div",Fe,[x((o(),i("div",{onClick:S,class:"h-full aspect-square rounded-full bg-black/10 flex items-center justify-center cursor-pointer anim-hover-1",delay:100},N[4]||(N[4]=[e("svg",{class:"w-[50%] h-[50%]",viewBox:"0 0 24 24",fill:"none",stroke:"black","stroke-width":"2"},[e("path",{d:"M19 12H5M12 19l-7-7 7-7"})],-1)]))),[[O]]),x((o(),i("p",Ee,[ge(y(_.value?n(l)("news.editNews"):n(l)("news.createNews")),1)])),[[O]]),x((o(),i("div",{onClick:V,class:"h-full aspect-square rounded-full flex items-center justify-center cursor-pointer anim-hover-1",delay:200},N[5]||(N[5]=[e("svg",{class:"w-full h-full",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{width:"41",height:"41",rx:"20.5",fill:"#151515","fill-opacity":"0.1"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.6757 13.7629C29.0828 14.136 29.1103 14.7686 28.7372 15.1757L17.7372 27.1758C17.5529 27.3768 17.2944 27.4939 17.0217 27.4998C16.749 27.5057 16.4858 27.4 16.2929 27.2071L11.7929 22.7071C11.4024 22.3166 11.4024 21.6834 11.7929 21.2929C12.1834 20.9024 12.8166 20.9024 13.2071 21.2929L16.9686 25.0544L27.2628 13.8243C27.636 13.4172 28.2686 13.3897 28.6757 13.7629Z",fill:"black"})],-1)]))),[[O]])])])])),[[I]]),x((o(),i("div",Te,[x(e("input",{"onUpdate:modelValue":N[1]||(N[1]=L=>m.value=L),type:"text",class:"w-[90%] h-[70%] bg-transparent outline-none border-b font-['SFPRO'] border-black/20 text-[14em] placeholder-black/30",placeholder:n(l)("news.newsTitle")},null,8,Re),[[X,m.value]])])),[[M]]),x((o(),i("div",Oe,[x(e("textarea",{"onUpdate:modelValue":N[2]||(N[2]=L=>b.value=L),maxlength:2e3,class:"w-full h-full bg-transparent resize-none leading-none overflow-auto no-scrollbar border-b border-black/20 outline-none text-[13em] font-['SFPRO'] placeholder-black/30",placeholder:n(l)("news.newsContent")},null,8,De),[[X,b.value]])])),[[O]]),u.value.length>0?(o(),i("div",je,[Z(n(ue),{modules:$,"slides-per-view":"auto","space-between":8,"free-mode":!0,class:"w-full"},{default:B(()=>[(o(!0),i(z,null,Y(u.value,(L,v)=>(o(),W(n(ce),{key:v,class:"!w-[80em]"},{default:B(()=>[x((o(),i("div",{class:"relative w-[80em] h-[80em] rounded-[12em] overflow-hidden",delay:400+v*50},[n(f).isVideo(L)?(o(),i("video",{key:0,class:"w-full h-full object-cover",src:L,preload:"metadata",muted:""},"Your browser does not support the video tag.",8,He)):(o(),i("img",{key:1,src:L,class:"w-full h-full object-cover",alt:"Selected photo"},null,8,Be)),n(f).isVideo(L)?(o(),i("div",Ze,[e("div",Ie,[e("img",{src:n(he)["photos/play.svg"],class:"h-[100%]",alt:""},null,8,We)])])):R("",!0),e("div",{onClick:w=>D(v),class:"absolute top-[4em] right-[4em] w-[24em] h-[24em] rounded-full bg-black/60 flex items-center justify-center cursor-pointer hover:bg-black/80 transition-all z-10"},N[6]||(N[6]=[e("svg",{class:"w-[14em] h-[14em]",viewBox:"0 0 24 24",fill:"none",stroke:"white","stroke-width":"2"},[e("path",{d:"M18 6L6 18M6 6l12 12"})],-1)]),8,Ue)],8,Ve)),[[d]])]),_:2},1024))),128))]),_:1})])):R("",!0),x((o(),i("div",{onClick:N[3]||(N[3]=L=>p.value=!0),class:"w-full h-[40em] px-[14em] flex items-center cursor-pointer anim-hover-1",delay:350},[N[7]||(N[7]=ye('<svg class="h-[50%]" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M26.8172 10.3775C26.2639 9.8241 25.4619 9.48583 23.8343 9.32573L24.0953 6.67188C25.9567 6.85497 27.5033 7.29233 28.7029 8.49187C29.778 9.56693 30.2407 10.9208 30.4571 12.5302C30.6656 14.0808 30.6655 16.0525 30.6655 18.4997V18.6949C30.6655 21.1423 30.6656 23.114 30.4571 24.6645C30.2407 26.274 29.778 27.6279 28.7029 28.7029C27.6279 29.778 26.274 30.2407 24.6645 30.4571C23.114 30.6656 21.1423 30.6655 18.6949 30.6655H18.4997C16.0525 30.6655 14.0808 30.6656 12.5302 30.4571C10.9208 30.2407 9.56693 29.778 8.49187 28.7029C7.29233 27.5033 6.85497 25.9567 6.67188 24.0953L9.32573 23.8343C9.48583 25.4619 9.8241 26.2639 10.3775 26.8172C10.8745 27.3143 11.5718 27.6376 12.8856 27.8141C14.2377 27.996 16.0295 27.9988 18.5973 27.9988C21.1653 27.9988 22.9571 27.996 24.3092 27.8141C25.6229 27.6376 26.3203 27.3143 26.8172 26.8172C27.3143 26.3203 27.6376 25.6229 27.8141 24.3092C27.996 22.9571 27.9988 21.1653 27.9988 18.5973C27.9988 16.0295 27.996 14.2377 27.8141 12.8856C27.6376 11.5718 27.3143 10.8745 26.8172 10.3775Z" fill="black"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M13.2364 1.3335H13.4316C15.8628 1.33346 17.8225 1.33343 19.3637 1.54066C20.964 1.75579 22.3113 2.21604 23.3813 3.28612C24.4515 4.35619 24.9117 5.70352 25.1268 7.30372C25.3341 8.84499 25.334 10.8046 25.334 13.2359V13.4311C25.334 15.8623 25.3341 17.822 25.1268 19.3632C24.9117 20.9635 24.4515 22.3108 23.3813 23.3808C22.3113 24.451 20.964 24.9112 19.3637 25.1263C17.8225 25.3336 15.8628 25.3335 13.4316 25.3335H13.2364C10.8051 25.3335 8.84548 25.3336 7.30421 25.1263C5.70401 24.9112 4.35668 24.451 3.28661 23.3808C2.21653 22.3108 1.75628 20.9635 1.54115 19.3632C1.33392 17.822 1.33395 15.8623 1.33399 13.4311V13.236C1.33395 10.8047 1.33392 8.84499 1.54115 7.30372C1.75628 5.70352 2.21653 4.35619 3.28661 3.28612C4.35668 2.21604 5.70401 1.75579 7.30421 1.54066C8.84548 1.33343 10.8052 1.33346 13.2364 1.3335ZM7.65953 4.18354C6.35504 4.35892 5.66425 4.67971 5.17223 5.17174C4.6802 5.66376 4.35941 6.35455 4.18403 7.65904C4.00349 9.0019 4.00065 10.7816 4.00065 13.3335C4.00065 15.8854 4.00349 17.6651 4.18403 19.0079C4.35941 20.3124 4.6802 21.0032 5.17223 21.4952C5.66425 21.9872 6.35504 22.308 7.65953 22.4835C9.00239 22.664 10.7821 22.6668 13.334 22.6668C15.8859 22.6668 17.6656 22.664 19.0084 22.4835C20.3129 22.308 21.0037 21.9872 21.4957 21.4952C21.9877 21.0032 22.3085 20.3124 22.484 19.0079C22.6645 17.6651 22.6673 15.8854 22.6673 13.3335C22.6673 10.7816 22.6645 9.0019 22.484 7.65904C22.3085 6.35455 21.9877 5.66376 21.4957 5.17174C21.0037 4.67971 20.3129 4.35892 19.0084 4.18354C17.6656 4.003 15.8859 4.00016 13.334 4.00016C10.7821 4.00016 9.00239 4.003 7.65953 4.18354Z" fill="black"></path><path d="M15.5144 16.5548C12.5728 14.6156 8.90643 13.6029 5.16782 13.6696C4.28815 13.6681 3.40981 13.7227 2.54065 13.8324C2.0397 13.8957 1.66453 14.3225 1.66602 14.8275C1.67213 16.888 1.70637 18.5236 1.9369 19.8299C2.17433 21.1752 2.63243 22.2525 3.53197 23.1469C4.53447 24.1437 5.8051 24.5859 7.37561 24.7957C8.90249 24.9999 10.8538 24.9999 13.3188 24.9999H13.5184C16.3763 25 18.5564 25 20.1995 24.6645C20.4796 24.6073 20.7219 24.4329 20.865 24.1853C21.0082 23.9379 21.0386 23.6409 20.9484 23.3695C20.0491 20.6619 18.1362 18.2832 15.5144 16.5548Z" fill="black"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16 9.00016C16 8.07968 16.7428 7.3335 17.6592 7.3335C18.5691 7.3335 19.3333 8.08 19.3333 9.00016C19.3333 9.92032 18.5691 10.6668 17.6592 10.6668C16.7428 10.6668 16 9.92064 16 9.00016Z" fill="black"></path></svg>',1)),e("p",qe,y(n(l)("news.addImage")),1)])),[[j]])])):R("",!0)}}},K=xe("news",()=>{const c=Q(),a=k([]),l=k([]),f=k(null),r=k(!1),g=k(""),m=k(1),b=k(10),u=k(!0),$=U(()=>{if(!g.value)return a.value;const s=g.value.toLowerCase();return a.value.filter(t=>t.title.toLowerCase().includes(s)||t.content.toLowerCase().includes(s)||t.author_name.toLowerCase().includes(s))}),p=U(()=>[...$.value].sort((s,t)=>new Date(t.created_at)-new Date(s.created_at))),_=U(()=>s=>{const t=a.value.find(h=>h.id===s);return t?t.phone_number===c.phoneData.phone_number:!1}),S=(s=1)=>F(void 0,null,function*(){r.value=!0;try{const t=yield H("NEWS_GET_ALL",{page:s,limit:b.value});t.success?(s===1?a.value=t.news||[]:a.value.push(...t.news||[]),u.value=t.news&&t.news.length===b.value,m.value=s):c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Failed to fetch news"})}catch(t){console.error("Error fetching news:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error loading news articles"})}finally{r.value=!1}}),T=(s=1)=>F(void 0,null,function*(){r.value=!0;try{const t=yield H("NEWS_GET_MY_POSTS",{page:s,limit:b.value});t.success?(s===1?l.value=t.news||[]:l.value.push(...t.news||[]),u.value=t.news&&t.news.length===b.value):c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Failed to fetch your news"})}catch(t){console.error("Error fetching my news:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error loading your articles"})}finally{r.value=!1}}),D=s=>F(void 0,null,function*(){r.value=!0;try{const t=yield H("NEWS_GET_POST",{id:s});return t.success?(f.value=t.article,t.article):(c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Article not found"}),null)}catch(t){return console.error("Error fetching article:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error loading article"}),null}finally{r.value=!1}}),V=s=>F(void 0,null,function*(){if(!s){yield S();return}r.value=!0;try{const t=yield H("NEWS_SEARCH",{query:s});t.success?(a.value=t.news||[],g.value=s):c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Search failed"})}catch(t){console.error("Error searching news:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error searching articles"})}finally{r.value=!1}}),C=s=>F(void 0,null,function*(){try{return yield H("NEWS_VALIDATE_POST",s)}catch(t){return console.error("Error validating post:",t),{success:!1,message:"Validation failed"}}}),N=s=>F(void 0,null,function*(){r.value=!0;try{const t=yield C(s);if(!t.success)return c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Validation failed"}),!1;const h=yield H("NEWS_CREATE_POST",s);return h.success?(c.TriggerNotification({appname:"news",header:"Daily News",message:"Article published successfully!"}),yield S(),!0):(c.TriggerNotification({appname:"news",header:"Daily News",message:h.message||"Failed to publish article"}),!1)}catch(t){return console.error("Error creating post:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error publishing article"}),!1}finally{r.value=!1}}),O=s=>F(void 0,null,function*(){r.value=!0;try{const t=yield C(s);if(!t.success)return c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Validation failed"}),!1;const h=yield H("NEWS_UPDATE_POST",s);if(h.success){c.TriggerNotification({appname:"news",header:"Daily News",message:"Article updated successfully!"});const P=a.value.findIndex(q=>q.id===s.id);P!==-1&&(a.value[P]=G(G({},a.value[P]),s));const A=l.value.findIndex(q=>q.id===s.id);return A!==-1&&(l.value[A]=G(G({},l.value[A]),s)),!0}else return c.TriggerNotification({appname:"news",header:"Daily News",message:h.message||"Failed to update article"}),!1}catch(t){return console.error("Error updating post:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error updating article"}),!1}finally{r.value=!1}}),I=s=>F(void 0,null,function*(){r.value=!0;try{const t=yield H("NEWS_DELETE_POST",s);return t.success?(c.TriggerNotification({appname:"news",header:"Daily News",message:"Article deleted successfully!"}),a.value=a.value.filter(h=>h.id!==s),l.value=l.value.filter(h=>h.id!==s),!0):(c.TriggerNotification({appname:"news",header:"Daily News",message:t.message||"Failed to delete article"}),!1)}catch(t){return console.error("Error deleting post:",t),c.TriggerNotification({appname:"news",header:"Daily News",message:"Error deleting article"}),!1}finally{r.value=!1}}),M=()=>F(void 0,null,function*(){!u.value||r.value||(yield S(m.value+1))}),d=s=>{const t=new Date(s),P=Math.floor((new Date-t)/1e3);return P<60?"just now":P<3600?`${Math.floor(P/60)} minutes ago`:P<86400?`${Math.floor(P/3600)} hours ago`:P<604800?`${Math.floor(P/86400)} days ago`:t.toLocaleDateString()},j=s=>{a.value.unshift(s),c.TriggerNotification({appname:"news",header:"Daily News",message:`New article: ${s.title}`})},L=s=>{const t=a.value.findIndex(P=>P.id===s.id);t!==-1&&(a.value[t]=s);const h=l.value.findIndex(P=>P.id===s.id);h!==-1&&(l.value[h]=s)},v=s=>{a.value=a.value.filter(t=>t.id!==s),l.value=l.value.filter(t=>t.id!==s)},w=()=>{a.value=[],l.value=[],f.value=null,r.value=!1,g.value="",m.value=1,u.value=!0};return window.addEventListener("message",s=>{const{type:t,payload:h}=s.data;switch(t){case"NEW_NEWS_POST":j(h);break;case"UPDATE_NEWS_POST":L(h);break;case"DELETE_NEWS_POST":v(h);break}}),{newsArticles:a,myNewsArticles:l,currentArticle:f,isLoading:r,searchQuery:g,currentPage:m,pageLimit:b,hasMoreArticles:u,filteredArticles:$,sortedArticles:p,userCanEdit:_,fetchAllNews:S,fetchMyNews:T,fetchArticle:D,searchNews:V,createPost:N,updatePost:O,deletePost:I,loadMoreArticles:M,formatTimeAgo:d,resetStore:w}}),Ge={key:0,class:"w-full h-full bg-[#FFF2C7] flex flex-col"},ze={class:"w-full h-[92em] flex items-end justify-center shrink-0",delay:50},Qe={class:"w-[90%] h-[50%]"},Ye={class:"w-full h-[71%] flex justify-between items-center"},Je={class:"w-full h-[calc(100%-92em)] px-[15em] overflow-y-auto no-scrollbar",delay:100},Ke={class:"w-full inline-flex"},Xe={class:"font-['SFPRO'] text-[18em] text-black leading-none w-full"},e1={class:"w-full h-[33em] flex items-center"},t1={class:"font-['SFPRO'] text-[10em] text-black/40"},l1={class:"w-full h-[35em]"},s1={class:"w-full h-[100%] flex justify-between"},o1={class:"w-[84%] h-full flex flex-col justify-center"},n1={class:"font-['SFPRO'] text-[10em] text-black/60 leading-none"},i1={class:"font-['SFPRO'] text-[13em] text-black leading-none mt-[.1em]"},a1={class:"w-full inline-flex"},r1={class:"font-['SFPRO'] text-[13em] text-black leading-none w-full"},c1={key:0,class:"w-full py-[15em] shrink-0"},u1=["delay"],d1=["onClick","src"],f1=["onClick","src"],h1=["onClick"],m1={class:"w-[35em] h-[35em] rounded-full bg-black/30 flex items-center justify-center backdrop-blur-sm"},v1=["src"],w1={__name:"ReadNews",props:{show:{type:Boolean,required:!0},article:{type:Object,default:null}},emits:["back"],setup(c,{emit:a}){const{t:l}=J(),f=Q(),r=c,g=K(),m=a,b=[me,$e],u=U(()=>r.article?r.article:{title:"",author_name:"",created_at:new Date().toISOString(),content:"",media:[]}),$=p=>{const _=f.isVideo(p);f.setPhotoViewerData({image:p,type:_?"video":"image"})};return(p,_)=>{const S=E("motion-fade"),T=E("motion-slide-top"),D=E("motion-pop"),V=E("motion-slide-bottom");return c.show?(o(),i("div",Ge,[x((o(),i("div",ze,[e("div",Qe,[e("div",Ye,[x((o(),i("div",{onClick:_[0]||(_[0]=C=>m("back")),class:"h-full aspect-square rounded-full flex items-center justify-center cursor-pointer anim-hover-1",delay:100},_[1]||(_[1]=[e("svg",{class:"w-full h-full",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{width:"41",height:"41",rx:"20.5",fill:"#151515"}),e("path",{d:"M20.207 13.7927C19.8409 13.4266 19.2619 13.404 18.8691 13.7244L18.793 13.7927L12.793 19.7927L12.7246 19.8689C12.4043 20.2617 12.4269 20.8407 12.793 21.2068L18.793 27.2068C19.1835 27.5973 19.8165 27.5973 20.207 27.2068C20.5975 26.8163 20.5975 26.1833 20.207 25.7927L15.9141 21.4998H27.5C28.0523 21.4998 28.5 21.052 28.5 20.4998C28.5 19.9475 28.0523 19.4998 27.5 19.4998H15.9141L20.207 15.2068L20.2754 15.1306C20.5957 14.7379 20.5731 14.1589 20.207 13.7927Z",fill:"white"})],-1)]))),[[S]])])])])),[[T]]),x((o(),i("div",Je,[e("div",Ke,[e("p",Xe,y(u.value.title),1)]),e("div",e1,[e("p",t1,"Uploaded "+y(n(g).formatTimeAgo(u.value.created_at)),1)]),e("div",l1,[e("div",s1,[e("div",{class:"h-full aspect-square rounded-full bg-cover bg-center",style:ee({backgroundImage:`url(${n(f).GetPlayerPhotoByNumber(u.value.phone_number)})`})},null,4),e("div",o1,[e("p",n1,y(n(l)("news.publishedBy")),1),e("p",i1,y(u.value.author_name),1)])])]),_[2]||(_[2]=e("div",{class:"w-full h-[15em]"},null,-1)),e("div",a1,[e("p",r1,y(u.value.content),1)]),u.value.media&&u.value.media.length>0?(o(),i("div",c1,[Z(n(ue),{modules:b,"slides-per-view":1,"space-between":10,pagination:u.value.media.length>1?{clickable:!0}:!1,class:"w-full pb-[25em]"},{default:B(()=>[(o(!0),i(z,null,Y(u.value.media,(C,N)=>(o(),W(n(ce),{key:N},{default:B(()=>[x((o(),i("div",{class:"relative w-full h-[200em] rounded-[15em] overflow-hidden cursor-pointer anim-hover-1",delay:400+N*50},[n(f).isVideo(C)?(o(),i("video",{key:0,onClick:O=>$(C),class:"w-full h-full object-cover",src:C,preload:"metadata",muted:""}," Your browser does not support the video tag. ",8,d1)):(o(),i("img",{key:1,onClick:O=>$(C),src:C,class:"w-full h-full object-cover",alt:"Selected photo"},null,8,f1)),n(f).isVideo(C)?(o(),i("div",{key:2,onClick:O=>$(C),class:"absolute inset-0 flex items-center justify-center pointer-events-none"},[e("div",m1,[e("img",{src:n(he)["photos/play.svg"],class:"h-[60%]",alt:""},null,8,v1)])],8,h1)):R("",!0)],8,u1)),[[D]])]),_:2},1024))),128))]),_:1},8,["pagination"])])):R("",!0)])),[[V]])])):R("",!0)}}},se=ke(w1,[["__scopeId","data-v-018253dc"]]),p1={class:"w-full h-full relative"},_1={class:"w-full h-[88em] flex items-end justify-center",delay:50},C1={class:"w-[90%] h-[40em]",style:{"border-bottom":"1em solid #1f1f1f"}},g1={class:"w-full h-[70%] flex"},y1={key:0,class:"w-full h-full flex items-center",delay:50},x1={class:"w-full h-full flex items-center relative"},b1=["placeholder"],k1={class:"w-[90%] h-full flex items-center",delay:100},N1={class:"font-['SFPRO'] text-[23em] text-white"},$1={class:"w-full h-[calc(100%-200em)]"},P1={class:"w-full h-[44.5em] flex items-center px-[15em] relative",delay:250},S1={class:"font-['SFPRO'] text-[18em] text-white"},L1={key:0,class:"w-full h-[200em] flex items-center justify-center"},A1={class:"text-white text-[14em] font-['SFPRO']"},M1={key:1,class:"w-full h-[200em] flex items-center justify-center"},F1={class:"text-white/60 text-[14em] font-['SFPRO']"},E1=["delay"],T1={class:"w-[89.5%] h-full rounded-[21em] px-[15em] py-[13em] bg-[#FFF2C7]"},R1={class:"w-full h-full"},O1={class:"w-full h-[50em] flex items-center"},D1={class:"font-['SFPRO'] text-[18em] text-black leading-none w-full line-clamp-2"},j1={class:"w-full h-[16em] flex items-center"},V1={class:"font-['SFPRO'] text-[10em] text-black/40"},H1={class:"w-full h-[52em] flex items-center"},B1={class:"w-full h-[75%] flex justify-between"},Z1={class:"w-[80%] h-full flex flex-col justify-center"},I1={class:"font-['SFPRO'] text-[10em] text-black/60 leading-none"},W1={class:"font-['SFPRO'] text-[13em] text-black leading-none mt-[.1em]"},U1={class:"w-full h-[110em]"},q1={class:"font-['SFPRO'] text-[13em] text-black leading-none mt-[.1em] w-full line-clamp-[8]"},G1={class:"w-full h-[23em] flex items-end"},z1=["onClick"],Q1={class:"font-['SFPRO'] text-[10em] text-white"},Y1={key:3,class:"w-full h-[50em] flex items-center justify-center"},J1={class:"text-white/60 text-[12em] font-['SFPRO']"},K1={__name:"Main",emits:["changePage"],setup(c,{emit:a}){const{t:l}=J(),f=K(),r=Q(),{sortedArticles:g,isLoading:m}=de(f),b=U(()=>{var j,L,v,w,s;if(((j=r.PhoneData)==null?void 0:j.isAdmin)===!0)return!0;const M=(w=(v=(L=r.appConfig)==null?void 0:L.NewsConfig)==null?void 0:v.Permissions)==null?void 0:w.CreateNews;if(!M||M==="all")return!0;const d=(s=r.PhoneData)==null?void 0:s.playerJob;return d?d.name===M:!1}),u=k(!1),$=k(""),p=k(null),_=()=>{u.value=!0},S=k(!1),T=k(!1),D=()=>{u.value=!1,$.value="",f.searchQuery="",f.fetchAllNews()},V=a,C=()=>F(this,null,function*(){yield f.searchNews($.value)}),N=M=>{p.value=M,T.value=!0},O=M=>F(this,null,function*(){let d;M.id?d=yield f.updatePost(M):d=yield f.createPost(M),d&&(S.value=!1)}),I=M=>{const d=M.target;d.scrollHeight-d.scrollTop<=d.clientHeight+100&&f.loadMoreArticles()};return te(()=>F(this,null,function*(){g.value.length===0&&(yield f.fetchAllNews())})),(M,d)=>{const j=E("motion-pop-up"),L=E("motion-pop"),v=E("motion-slide-left"),w=E("motion-fade"),s=E("motion-slide-top"),t=E("motion-slide-bottom");return o(),i("div",p1,[x(Z(le,{delay:100,show:S.value,onBack:d[0]||(d[0]=h=>S.value=!1),onPublish:O},null,8,["show"]),[[j]]),x(Z(se,{delay:100,show:T.value,article:p.value,onBack:d[1]||(d[1]=h=>T.value=!1)},null,8,["show","article"]),[[j]]),!S.value&&!T.value&&b.value?x((o(),i("div",{key:0,onClick:d[2]||(d[2]=h=>S.value=!0),class:"h-[50em] aspect-square rounded-full absolute bottom-[13em] right-[17em] z-[2] cursor-pointer anim-hover-1",delay:600},d[5]||(d[5]=[e("svg",{class:"w-full h-full",viewBox:"0 0 72 72",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{x:"2",y:"2",width:"68",height:"68",rx:"34",fill:"#FFF2C7",stroke:"black","stroke-width":"4"}),e("path",{d:"M36 26.5C36.8285 26.5 37.5 27.1716 37.5 28V34.5H44C44.8285 34.5 45.5 35.1715 45.5 36C45.5 36.8285 44.8285 37.5 44 37.5H37.5V44C37.5 44.8285 36.8285 45.5 36 45.5C35.1715 45.5 34.5 44.8285 34.5 44V37.5H28C27.1716 37.5 26.5 36.8285 26.5 36C26.5 35.1715 27.1716 34.5 28 34.5H34.5V28C34.5 27.1716 35.1715 26.5 36 26.5Z",fill:"black",stroke:"black","stroke-width":"0.5"})],-1)]))),[[L]]):R("",!0),x((o(),i("div",_1,[e("div",C1,[e("div",g1,[u.value?x((o(),i("div",y1,[e("div",x1,[(o(),i("svg",{class:"h-[40%] absolute right-[10em] cursor-pointer anim-hover-1",onClick:D,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d[6]||(d[6]=[e("path",{d:"M12.2928 0.29289C12.6833 -0.09763 13.3163 -0.09763 13.7068 0.29289C14.0973 0.68342 14.0973 1.31643 13.7068 1.70696L8.41288 6.99994L13.7058 12.2929L13.7752 12.369C14.0952 12.7618 14.0718 13.3409 13.7058 13.7069C13.3397 14.073 12.7607 14.0957 12.3679 13.7753L12.2918 13.7069L6.99878 8.41394L1.70777 13.7059C1.31725 14.0965 0.684245 14.0964 0.293715 13.7059C-0.0968055 13.3154 -0.0968055 12.6824 0.293715 12.2919L5.58468 6.99994L0.292735 1.70793L0.224374 1.63176C-0.0960157 1.23901 -0.0733354 0.66001 0.292735 0.29387C0.658725 -0.0721201 1.23786 -0.0954603 1.63062 0.22453L1.7068 0.29387L6.99878 5.58584L12.2928 0.29289Z",fill:"#ffffff60"},null,-1)]))),x(e("input",{"onUpdate:modelValue":d[3]||(d[3]=h=>$.value=h),onInput:C,type:"text",class:"w-full h-full bg-white/10 rounded-full text-[12em] font-['SFPRO'] px-[1em] text-white placeholder-white/50 outline-none border-none",placeholder:n(l)("news.searchNews"),autofocus:""},null,40,b1),[[X,$.value]])])])),[[v]]):(o(),i(z,{key:1},[x((o(),i("div",k1,[e("p",N1,y(n(l)("news.title")),1)])),[[v]]),x((o(),i("div",{class:"w-[10%] h-full cursor-pointer",delay:150,onClick:_},d[7]||(d[7]=[e("svg",{class:"h-full w-full",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{width:"41",height:"41",rx:"20.5",fill:"#151515"}),e("path",{d:"M11.5 18.7803C11.5 19.7838 11.6904 20.725 12.0711 21.6039C12.4519 22.4828 12.98 23.2567 13.6556 23.9258C14.3311 24.5948 15.1126 25.1178 16 25.4949C16.8874 25.872 17.8378 26.0605 18.8511 26.0605C19.6495 26.0605 20.411 25.9389 21.1356 25.6956C21.8603 25.4523 22.5236 25.1178 23.1254 24.6921L27.6576 29.1897C27.7682 29.2932 27.8895 29.3708 28.0215 29.4225C28.1535 29.4742 28.2933 29.5 28.4407 29.5C28.6495 29.5 28.8337 29.4529 28.9934 29.3586C29.153 29.2643 29.2774 29.135 29.3664 28.9709C29.4555 28.8066 29.5 28.6241 29.5 28.4234C29.5 28.2775 29.4739 28.1407 29.4217 28.0129C29.3695 27.8852 29.2943 27.7727 29.1961 27.6754L24.6914 23.1868C25.1643 22.5786 25.5343 21.9004 25.8014 21.1523C26.0686 20.4042 26.2021 19.6135 26.2021 18.7803C26.2021 17.7767 26.0118 16.8355 25.6311 15.9567C25.2503 15.0778 24.7221 14.3039 24.0466 13.6348C23.3711 12.9658 22.5896 12.4427 21.7021 12.0656C20.8147 11.6885 19.8644 11.5 18.8511 11.5C17.8378 11.5 16.8874 11.6885 16 12.0656C15.1126 12.4427 14.3311 12.9658 13.6556 13.6348C12.98 14.3039 12.4519 15.0778 12.0711 15.9567C11.6904 16.8355 11.5 17.7767 11.5 18.7803ZM13.0752 18.7803C13.0752 17.9896 13.2242 17.2491 13.522 16.5588C13.8199 15.8685 14.2344 15.2603 14.7656 14.7342C15.2968 14.2081 15.911 13.7975 16.608 13.5025C17.305 13.2075 18.0527 13.0601 18.8511 13.0601C19.6495 13.0601 20.3971 13.2075 21.0942 13.5025C21.7912 13.7975 22.4038 14.2081 22.9319 14.7342C23.4601 15.2603 23.8746 15.8685 24.1756 16.5588C24.4765 17.2491 24.6269 17.9896 24.6269 18.7803C24.6269 19.5709 24.4765 20.3114 24.1756 21.0018C23.8746 21.6921 23.4601 22.2988 22.9319 22.8218C22.4038 23.3449 21.7912 23.7554 21.0942 24.0535C20.3971 24.3515 19.6495 24.5005 18.8511 24.5005C18.0527 24.5005 17.305 24.3515 16.608 24.0535C15.911 23.7554 15.2968 23.3449 14.7656 22.8218C14.2344 22.2988 13.8199 21.6921 13.522 21.0018C13.2242 20.3114 13.0752 19.5709 13.0752 18.7803Z",fill:"white"})],-1)]))),[[w]]),b.value?x((o(),i("div",{key:0,onClick:d[4]||(d[4]=h=>V("changePage","MyNews")),class:"w-[10%] h-full ml-[5em]",delay:200},d[8]||(d[8]=[e("svg",{class:"w-full h-full cursor-pointer anim-hover-1",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{width:"41",height:"41",rx:"20.5",fill:"#151515"}),e("path",{d:"M15.25 16.5C15.25 13.6005 17.6005 11.25 20.5 11.25C23.3995 11.25 25.75 13.6005 25.75 16.5C25.75 19.3995 23.3995 21.75 20.5 21.75C17.6005 21.75 15.25 19.3995 15.25 16.5Z",fill:"white"}),e("path",{d:"M12.75 29C12.75 24.7198 16.2198 21.25 20.5 21.25C24.7802 21.25 28.25 24.7198 28.25 29C28.25 29.4142 27.9142 29.75 27.5 29.75H13.5C13.0858 29.75 12.75 29.4142 12.75 29Z",fill:"white"})],-1)]))),[[w]]):R("",!0)],64))])])])),[[s]]),e("div",{class:"w-full h-[calc(100%-88em)] overflow-auto no-scrollbar flex flex-col relative",onScroll:I},[e("div",$1,[x((o(),i("div",P1,[e("p",S1,y(n(l)("news.todaysFeed")),1)])),[[v]]),n(m)&&n(g).length===0?(o(),i("div",L1,[e("div",A1,y(n(l)("news.loadingNews")),1)])):!n(m)&&n(g).length===0?(o(),i("div",M1,[e("div",F1,y(n(l)("news.noNewsArticles")),1)])):(o(!0),i(z,{key:2},Y(n(g),(h,P)=>x((o(),i("div",{key:h.id,class:fe(["w-full h-[278.5em] flex items-center justify-center",P===0?"":"mt-[15em]"]),delay:300+P*50},[e("div",T1,[e("div",R1,[e("div",O1,[e("p",D1,y(h.title),1)]),e("div",j1,[e("p",V1,y(n(l)("news.uploaded"))+" "+y(n(f).formatTimeAgo(h.created_at)),1)]),e("div",H1,[e("div",B1,[e("div",{class:"h-full aspect-square rounded-full bg-cover bg-center",style:ee({backgroundImage:`url(${n(r).GetPlayerPhotoByNumber(h.phone_number)})`})},null,4),e("div",Z1,[e("p",I1,y(n(l)("news.publishedBy")),1),e("p",W1,y(h.author_name),1)])])]),e("div",U1,[e("p",q1,y(h.content),1)]),e("div",G1,[e("div",{onClick:A=>N(h),class:"inline-flex h-[80%] items-center p-[10em] bg-black rounded-full cursor-pointer anim-hover-1"},[e("p",Q1,y(n(l)("news.readMore")),1)],8,z1)])])])],10,E1)),[[t]])),128)),n(m)&&n(g).length>0?(o(),i("div",Y1,[e("div",J1,y(n(l)("news.loadingMore")),1)])):R("",!0),d[9]||(d[9]=e("div",{class:"w-full h-[274em]"},null,-1))])],32)])}}},X1={class:"w-full h-full relative"},et={class:"w-full h-[88em] flex items-end justify-center",delay:50},tt={class:"w-[90%] h-[40em] flex items-center justify-center relative",style:{"border-bottom":"1em solid #1f1f1f"}},lt={class:"font-['SFPRO'] text-[23em] text-white truncate px-[2em]"},st={class:"w-full h-[calc(100%-88em)] overflow-auto no-scrollbar flex flex-col relative pt-[15em]"},ot={class:"w-full h-[calc(100%-200em)]"},nt={key:0,class:"w-full h-[200em] flex items-center justify-center"},it={class:"text-white text-[14em] font-['SFPRO']"},at={key:1,class:"w-full h-[200em] flex items-center justify-center"},rt={class:"text-white/60 text-[14em] font-['SFPRO']"},ct=["delay"],ut={class:"w-[89.5%] h-full rounded-[21em] px-[15em] py-[13em] bg-[#FFF2C7]"},dt={class:"w-full h-full"},ft={class:"w-full h-[50em] flex items-center"},ht={class:"font-['SFPRO'] text-[18em] text-black leading-none w-full line-clamp-2"},mt={class:"w-full h-[16em] flex items-center"},vt={class:"font-['SFPRO'] text-[10em] text-black/40"},wt={class:"w-full h-[52em] flex items-center"},pt={class:"w-full h-[75%] flex justify-between"},_t={class:"w-[80%] h-full flex flex-col justify-center"},Ct={class:"font-['SFPRO'] text-[10em] text-black/60 leading-none"},gt={class:"font-['SFPRO'] text-[13em] text-black leading-none mt-[.1em]"},yt={class:"w-full h-[110em]"},xt={class:"font-['SFPRO'] text-[13em] text-black leading-none mt-[.1em] w-full line-clamp-[8]"},bt={class:"w-full h-[23em] flex items-end justify-between"},kt=["onClick"],Nt={class:"font-['SFPRO'] text-[10em] text-white"},$t={class:"w-[50%] h-full flex justify-end items-center"},Pt=["onClick"],St=["onClick"],Lt={__name:"MyNews",emits:["changePage","editArticle","viewArticle"],setup(c,{emit:a}){const{t:l}=J(),f=K(),r=Q(),{myNewsArticles:g,isLoading:m,sortedArticles:b}=de(f),u=U(()=>{var v;return((v=r.PhoneData)==null?void 0:v.isAdmin)===!0?b.value:g.value}),$=k(!1),p=k(!1),_=k(null),S=k(null),T=k(null),D=k(!1),V=a,C=v=>{var w,s;return((w=r.PhoneData)==null?void 0:w.isAdmin)===!0?!0:v.phone_number===((s=r.PhoneData)==null?void 0:s.phone_number)},N=v=>{var w;return v.phone_number===((w=r.PhoneData)==null?void 0:w.phone_number)},O=v=>{_.value=v,$.value=!0},I=v=>{S.value=v,p.value=!0},M=v=>{T.value=v,D.value=!0},d=()=>{D.value=!1,T.value=null},j=()=>F(this,null,function*(){T.value&&(yield f.deletePost(T.value),D.value=!1,T.value=null)}),L=v=>F(this,null,function*(){let w;v.id?w=yield f.updatePost(v):w=yield f.createPost(v),w&&(p.value=!1,S.value=null,yield f.fetchMyNews())});return te(()=>F(this,null,function*(){var v;((v=r.PhoneData)==null?void 0:v.isAdmin)===!0?yield f.fetchAllNews():yield f.fetchMyNews()})),(v,w)=>{var P;const s=E("motion-pop-up"),t=E("motion-slide-top"),h=E("motion-slide-bottom");return o(),i("div",X1,[x(Z(se,{delay:100,show:$.value,article:_.value,onBack:w[0]||(w[0]=A=>$.value=!1)},null,8,["show","article"]),[[s]]),x(Z(le,{delay:100,show:p.value,editData:S.value,onBack:w[1]||(w[1]=A=>p.value=!1),onPublish:L},null,8,["show","editData"]),[[s]]),D.value?(o(),W(Ne,{key:0,onCancel:d,onSubmit:j,header:n(l)("news.areYouSure"),label:n(l)("news.deleteConfirmMessage"),buttons:{cancel:n(l)("news.cancel"),submit:n(l)("news.delete")}},null,8,["header","label","buttons"])):R("",!0),x((o(),i("div",et,[e("div",tt,[(o(),i("svg",{onClick:w[2]||(w[2]=A=>V("changePage","MainPage")),class:"h-[75%] absolute left-0 cursor-pointer anim-hover-1",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w[3]||(w[3]=[e("rect",{width:"41",height:"41",rx:"20.5",fill:"#151515"},null,-1),e("path",{d:"M20.207 13.7927C19.8409 13.4266 19.2619 13.404 18.8691 13.7244L18.793 13.7927L12.793 19.7927L12.7246 19.8689C12.4043 20.2617 12.4269 20.8407 12.793 21.2068L18.793 27.2068C19.1835 27.5973 19.8165 27.5973 20.207 27.2068C20.5975 26.8163 20.5975 26.1833 20.207 25.7927L15.9141 21.4998H27.5C28.0523 21.4998 28.5 21.052 28.5 20.4998C28.5 19.9475 28.0523 19.4998 27.5 19.4998H15.9141L20.207 15.2068L20.2754 15.1306C20.5957 14.7379 20.5731 14.1589 20.207 13.7927Z",fill:"white"},null,-1)]))),e("p",lt,y((P=n(r).PhoneData)!=null&&P.isAdmin?"All News (Admin)":n(l)("news.myNews")),1)])])),[[t]]),e("div",st,[e("div",ot,[n(m)&&n(g).length===0?(o(),i("div",nt,[e("div",it,y(n(l)("news.loadingNews")),1)])):!n(m)&&u.value.length===0?(o(),i("div",at,[e("div",rt,y(n(l)("news.noMyNews")),1)])):(o(!0),i(z,{key:2},Y(u.value,(A,q)=>x((o(),i("div",{key:A.id,class:fe(["w-full h-[278.5em] flex items-center justify-center",q===0?"":"mt-[15em]"]),delay:300+q*50},[e("div",ut,[e("div",dt,[e("div",ft,[e("p",ht,y(A.title),1)]),e("div",mt,[e("p",vt,y(n(l)("news.uploaded"))+" "+y(n(f).formatTimeAgo(A.created_at)),1)]),e("div",wt,[e("div",pt,[e("div",{class:"h-full aspect-square rounded-full bg-cover bg-center",style:ee({backgroundImage:`url(${n(r).GetPlayerPhotoByNumber(A.phone_number)})`})},null,4),e("div",_t,[e("p",Ct,y(n(l)("news.publishedBy")),1),e("p",gt,y(A.author_name),1)])])]),e("div",yt,[e("p",xt,y(A.content),1)]),e("div",bt,[e("div",{onClick:oe=>O(A),class:"inline-flex h-[80%] items-center p-[10em] bg-black rounded-full cursor-pointer anim-hover-1"},[e("p",Nt,y(n(l)("news.readMore")),1)],8,kt),e("div",$t,[N(A)?(o(),i("svg",{key:0,onClick:oe=>I(A),class:"h-[85%] cursor-pointer anim-hover-1",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w[4]||(w[4]=[e("rect",{width:"32",height:"32",rx:"16",fill:"black"},null,-1),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.2564 10.0565C19.9984 9.31449 21.2015 9.31449 21.9435 10.0565C22.6856 10.7985 22.6856 12.0016 21.9435 12.7436L21.6371 13.05L18.95 10.3629L19.2564 10.0565ZM18.2429 11.0701L20.93 13.7571L16.844 17.8431C16.4416 18.2456 15.9373 18.5311 15.3852 18.6691L13.4547 19.1517C13.2843 19.1943 13.104 19.1444 12.9798 19.0202C12.8556 18.896 12.8057 18.7158 12.8483 18.5454L13.331 16.6148C13.469 16.0627 13.7545 15.5585 14.1569 15.1561L18.2429 11.0701ZM15.0092 10.8333H14.9682C13.9377 10.8333 13.1069 10.8333 12.4464 10.9114C11.7629 10.9922 11.178 11.1642 10.6849 11.5689C10.5208 11.7036 10.3703 11.8541 10.2356 12.0182C9.83089 12.5113 9.65883 13.0962 9.57804 13.7798C9.49997 14.4402 9.49999 15.271 9.5 16.3015V16.7139C9.49998 17.8959 9.49997 18.8485 9.60071 19.5978C9.70529 20.3757 9.92904 21.0307 10.4492 21.5508C10.9694 22.071 11.6243 22.2947 12.4022 22.3993C13.1514 22.5 14.1041 22.5 15.2859 22.5H15.6985C16.729 22.5 17.5598 22.5 18.2202 22.4219C18.9038 22.3411 19.4886 22.1691 19.9818 21.7644C20.1459 21.6297 20.2964 21.4793 20.431 21.3151C20.8358 20.822 21.0078 20.2371 21.0886 19.5536C21.1667 18.8931 21.1667 18.0623 21.1666 17.0319V16.9907C21.1666 16.6328 20.8765 16.3426 20.5185 16.3426C20.1606 16.3426 19.8704 16.6328 19.8704 16.9907C19.8704 18.072 19.8693 18.826 19.8013 19.4014C19.735 19.9625 19.6128 20.2689 19.429 20.4928C19.3482 20.5913 19.2579 20.6815 19.1594 20.7623C18.9355 20.9461 18.6292 21.0683 18.068 21.1346C17.4926 21.2027 16.7386 21.2037 15.6574 21.2037H15.3333C14.0929 21.2037 13.2277 21.2023 12.5749 21.1145C11.9408 21.0293 11.605 20.8734 11.3658 20.6342C11.1267 20.395 10.9707 20.0592 10.8854 19.4251C10.7977 18.7723 10.7963 17.9071 10.7963 16.6667V16.3426C10.7963 15.2613 10.7974 14.5074 10.8654 13.9319C10.9317 13.3708 11.0539 13.0645 11.2377 12.8405C11.3185 12.7421 11.4088 12.6518 11.5072 12.571C11.7311 12.3872 12.0375 12.265 12.5986 12.1987C13.174 12.1307 13.928 12.1296 15.0092 12.1296C15.3672 12.1296 15.6574 11.8394 15.6574 11.4815C15.6574 11.1235 15.3672 10.8333 15.0092 10.8333Z",fill:"white"},null,-1)]),8,Pt)):R("",!0),C(A)?(o(),i("svg",{key:1,onClick:oe=>M(A.id),class:"h-[85%] cursor-pointer anim-hover-1 ml-[5em]",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w[5]||(w[5]=[e("rect",{width:"32",height:"32",rx:"16",fill:"black"},null,-1),e("path",{d:"M10.5487 12.5003L11.0907 21.4441C11.1494 22.4117 11.9512 23.1665 12.9207 23.1665H19.0774C20.0468 23.1665 20.8487 22.4117 20.9074 21.4441L21.4494 12.5003L21.5282 11.3805C21.5364 11.2648 21.4447 11.1665 21.3287 11.1665H10.6883C10.5736 11.1665 10.4825 11.2627 10.4886 11.3772L10.5487 12.5003Z",fill:"white"},null,-1),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.5461 9.64209C13.7562 9.15185 14.2383 8.83398 14.7716 8.83398H17.2258C17.7591 8.83398 18.2412 9.15185 18.4513 9.64209L19.1048 11.1671H20.8162C20.8604 11.1671 20.9018 11.1671 20.9404 11.1673H20.976C20.9907 11.1667 21.0055 11.1667 21.0204 11.1673H21.9987C22.3669 11.1673 22.6654 11.4658 22.6654 11.834C22.6654 12.2022 22.3669 12.5007 21.9987 12.5007H9.9987C9.63051 12.5007 9.33203 12.2022 9.33203 11.834C9.33203 11.4658 9.63051 11.1673 9.9987 11.1673H10.977C10.9919 11.1667 11.0067 11.1667 11.0214 11.1673H11.0567C11.0953 11.1671 11.1366 11.1671 11.1809 11.1671H12.8925L13.5461 9.64209ZM17.2604 10.2481L17.6542 11.1671H14.3432L14.737 10.2481C14.758 10.1991 14.8062 10.1673 14.8596 10.1673H17.1378C17.1912 10.1673 17.2394 10.1991 17.2604 10.2481Z",fill:"white"},null,-1)]),8,St)):R("",!0)])])])])],10,ct)),[[h]])),128)),w[6]||(w[6]=e("div",{class:"w-full h-[274em]"},null,-1))])])])}}},At={class:"w-full rounded-[44em] h-full bg-black relative"},Vt={__name:"NewsApp",setup(c){const a=K(),l=k("MainPage"),f=k([{key:"MainPage"},{key:"CreateNews"},{key:"MyNews"},{key:"ReadNews"}]),r=k(null),g=k(null),m=(p,_=null)=>{p==="ReadNews"&&_?r.value=_:p==="CreateNews"&&_?g.value=_:p==="MainPage"&&(r.value=null,g.value=null),l.value=p};te(()=>F(this,null,function*(){yield a.fetchAllNews()})),be(()=>{a.resetStore()});const b=p=>F(this,null,function*(){let _;p.id?_=yield a.updatePost(p):_=yield a.createPost(p),_&&(m("MainPage"),g.value=null)}),u=p=>{g.value=p,m("CreateNews")},$=p=>{r.value=p,m("ReadNews")};return(p,_)=>(o(),i("div",At,[Z(Se,{"current-key":l.value,items:f.value,duration:300,easing:"ease-in-out"},{MainPage:B(()=>[l.value=="MainPage"?(o(),W(K1,{key:0,onChangePage:m})):R("",!0)]),CreateNews:B(()=>[l.value=="CreateNews"?(o(),W(le,{key:0,editData:g.value,onBack:_[0]||(_[0]=S=>m("MainPage")),onPublish:b},null,8,["editData"])):R("",!0)]),MyNews:B(()=>[l.value=="MyNews"?(o(),W(Lt,{key:0,onChangePage:m,onEditArticle:u,onViewArticle:$})):R("",!0)]),ReadNews:B(()=>[l.value=="ReadNews"?(o(),W(se,{key:0,article:r.value,onBack:_[1]||(_[1]=S=>m("MainPage"))},null,8,["article"])):R("",!0)]),_:1},8,["current-key","items"])]))}};export{Vt as default};
|