import{C as A,V as H,w as L,as as O,N as s,D as d,E as a,P as p,Q as i,O as o,S as r,K as m,a3 as _,R as l,u as e,at as R,F as W,J as x}from"./vendor-BGtMsOoo.js";import{i as F,q as k}from"./index-CRze-aDK.js";import{_ as j}from"./push-message.vue_vue_type_script_setup_true_lang-CDVGgRG_.js";import{u as q}from"./usePushMessages-DOn4Mvbs.js";import"./index-DbcF6rmZ.js";import"./types-zo7pMMkl.js";const G={class:"!block"},J={class:"flex items-start justify-between gap-3"},K={class:"mt-4 lg:mt-5"},Q={key:1,class:"p-3 lg:p-6"},X={class:"divide-y rounded border empty:hidden"},Y={key:0,class:"my-3 text-center"},ie=A({__name:"notifications",setup(Z){const{t:v}=H(),c=L("showUnreadOnly_pushMessages_history",!1);O(c,P);const{items:g,markReadAll:b,markUnreadAll:C,totalCount:$,unreadCountWithHidden:h,loading:B,pages:V,page:u}=q({showUnreadOnly:c,withHidden:!0});F({title:v("push_messages.title")});function P(){f(1)}function f(t){u.value=t,window.scroll({top:0,behavior:"smooth"})}return(t,y)=>{const M=s("VcBadge"),E=s("VcTypography"),I=s("VcButton"),w=s("VcMenuItem"),N=s("VcDropdownMenu"),S=s("VcSwitch"),U=s("VcEmptyView"),z=s("VcPagination"),D=s("VcWidget");return a(),d("div",G,[p("div",J,[i(E,{tag:"h1",class:"flex items-center gap-2"},{default:o(()=>[r(l(t.$t("push_messages.title"))+" ",1),e(h)>0?(a(),m(M,{key:0,variant:"outline",size:"lg",rounded:""},{default:o(()=>[r(l(e(h)),1)]),_:1})):_("",!0)]),_:1}),i(N,{placement:"bottom-end",width:"max-content"},{trigger:o(()=>[i(I,{"aria-label":t.$t("common.buttons.toggle_dropdown"),icon:"dots-vertical",variant:"outline",size:"sm"},null,8,["aria-label"])]),content:o(({close:n})=>[i(w,{onClick:T=>{n(),e(b)()}},{default:o(()=>[r(l(t.$t("push_messages.options.make_all_as_read")),1)]),_:2},1032,["onClick"]),i(w,{onClick:T=>{n(),e(C)()}},{default:o(()=>[r(l(t.$t("push_messages.options.make_all_as_unread")),1)]),_:2},1032,["onClick"])]),_:1})]),p("div",K,[i(S,{modelValue:e(c),"onUpdate:modelValue":y[0]||(y[0]=n=>R(c)?c.value=n:null),"aria-label":t.$t("push_messages.show_unread_only"),"label-position":"right"},{default:o(()=>[r(l(t.$t("push_messages.show_unread_only")),1)]),_:1},8,["modelValue","aria-label"])]),i(D,{size:"lg",class:"mt-4 lg:mt-5"},{"default-container":o(()=>[e($)===0&&!e(B)?(a(),m(U,{key:0,text:t.$t("push_messages.empty_list"),icon:"outline-notifications"},null,8,["text"])):(a(),d("div",Q,[p("div",X,[(a(!0),d(W,null,x(e(g),n=>(a(),m(j,{key:n.id,size:"lg",class:"first:rounded-t last:rounded-b","push-message":n},null,8,["push-message"]))),128))]),e(u)>=e(k)?(a(),d("p",Y,l(t.$t("reach_limit.page_limit")),1)):_("",!0),e(g).length&&e(V)>1?(a(),m(z,{key:1,page:e(u),pages:Math.min(e(V),e(k)),class:"mt-6","onUpdate:page":f},null,8,["page","pages"])):_("",!0)]))]),_:1})])}}});export{ie as default};
//# sourceMappingURL=notifications-Bx-GqOgn.js.map
