1import{d,j as y,q as V,z as B,I as k,c as N,w as n,k as E,o as u,a as t,b as l,g as o,n as C,h as e,L as i,l as M,C as R,x as z,e as h,i as F,t as w,p as $,f as P,T as U,F as q}from"./app.1c75f29f.js";import{_ as K}from"./AppLayout.78e80e3b.js";import{_ as O}from"./Pagination.96910016.js";import{r as f}from"./index.970b99d8.js";import{_ as G}from"./EmptyState.32308625.js";import"./Banner.7925d127.js";import"./ApplicationMark.85c52153.js";const H={class:"mt-8 mb-7 flex items-center justify-between"},J={class:"tab flex items-center gap-8"},Q={class:"flex gap-3 flex-grow justify-end"},W={class:"w-2/5 relative flex items-center"},X=t("i",{class:"icon-search text-gray-50 absolute text-2xl left-3 flex"},null,-1),Y=t("i",{class:"icon-plus-1 text-lg"},null,-1),Z={class:"grid lg:grid-cols-3 gap-5"},D=["src"],ee={class:"py-6 px-7 flex-grow flex flex-col justify-between"},te={class:"flex items-center justify-between"},se={class:"text-xs text-gray-90"},re=t("span",{class:"text-gray-60"},"Publish Date: ",-1),ae={class:"relative"},ne=["onClick"],le=t("i",{class:"icon-arrow---down-2 text-xs"},null,-1),oe={key:0,class:"absolute bg-white p-1 text-14-regular border border-gray-10 w-36 rounded-md top-10 right-0"},ie=["onClick"],ce={class:"my-5"},we={__name:"List",setup(de){let m=d("");const L=d(null);let c=d(null);const j=y(()=>f().current()),p=y(()=>E().props.value.news),A=a=>c.value===a?c.value=null:c.value=a;V(()=>{document.addEventListener("click",x)}),B(()=>{document.removeEventListener("click",x)});const x=a=>{a.target.closest(".news-actions")||(c.value=null)},S=a=>{const r=f().current()=="news.list"?"draft":"publish";k.Inertia.patch(`/admin/news/${a}/status/update`,{status:r})},b=d("text-indigo-60 border-indigo-60 text-16-medium border-b-2"),v=d("text-16-regular border-transparent text-gray-60"),T=_.debounce(a=>{let r="/admin/news";j.value=="news.drafts"&&(r="/admin/news/drafts"),k.Inertia.get(r,{filter:{title:a.target.value}},{preserveState:!0})},500);return(a,r)=>(u(),N(K,{title:"News"},{default:n(()=>[t("div",null,[t("div",H,[t("div",J,[l(e(i),{href:"/admin/news",class:C([e(f)().current()=="news.list"?e(b):e(v),"pb-2.5"])},{default:n(()=>[o(" Active News ")]),_:1},8,["class"]),l(e(i),{href:"/admin/news/drafts",class:C([e(f)().current()=="news.drafts"?e(b):e(v),"pb-2.5"])},{default:n(()=>[o("Drafted News ")]),_:1},8,["class"])]),t("div",Q,[t("div",W,[X,M(t("input",{type:"text",class:"bg-white placeholder:text-gray-50 border-0 rounded-lg block w-full h-full pl-14",placeholder:"Search news","onUpdate:modelValue":r[0]||(r[0]=s=>z(m)?m.value=s:m=s),ref_key:"searchInput",ref:L,onKeyup:r[1]||(r[1]=s=>e(T)(s))},null,544),[[R,e(m)]])]),l(e(i),{href:"/admin/news/create",class:"btn btn-primary py-3 flex items-center gap-2"},{default:n(()=>[o(" Add new news "),Y]),_:1})])]),t("div",Z,[e(p).data&&e(p).data.length>0?(u(!0),h(q,{key:0},F(e(p).data,(s,g)=>(u(),h("div",{class:"bg-white rounded-lg flex flex-col",key:g},[l(e(i),{href:`/admin/news/${s.slug}`},{default:n(()=>[t("img",{class:"bg-gray-40 h-52 object-cover w-full rounded-t-lg",src:s.banner},null,8,D)]),_:2},1032,["href"]),t("div",ee,[l(e(i),{href:`/admin/news/${s.slug}`,class:"text-20-medium mt-1 mb-5 block"},{default:n(()=>[o(w(s.title),1)]),_:2},1032,["href"]),t("div",te,[t("div",se,[re,o(w(s.published_at),1)]),t("div",ae,[t("div",{onClick:I=>A(g),class:"border border-gray-30 rounded-3 bg-gray-10 text-12-regular text-gray-80 flex items-center px-2 py-1 cursor-pointer news-actions"},[o(" Actions "),le],8,ne),l(U,{name:"fade"},{default:n(()=>[e(c)==g?(u(),h("ul",oe,[l(e(i),{href:`/admin/news/${s.slug}/edit`,onClick:r[2]||(r[2]=$(()=>{},["stop"])),class:"px-2 py-1.5 hover:bg-gray-10 rounded-md transition-all duration-200 cursor-pointer block"},{default:n(()=>[o(" Edit ")]),_:2},1032,["href"]),t("li",{onClick:$(I=>S(s.slug),["stop"]),class:"px-2 py-1.5 hover:bg-gray-10 rounded-md transition-all duration-200 cursor-pointer"},w(e(f)().current()=="news.list"?"Draft":"Restore"),9,ie)])):P("",!0)]),_:2},1024)])])])]))),128)):(u(),N(G,{key:1,show:!0,message:a.__("No news to catch up, sorry.")},null,8,["message"]))])]),t("div",ce,[l(O,{links:e(p).meta.links},null,8,["links"])])]),_:1}))}};export{we as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.