1import{i as t,a7 as I,M as q,U as D,C as B,ar as K,cj as z,a0 as H,E as y,A as W}from"./app-BAclpbpz.js";import{b as x,a as A,l as h,h as f,C as i,g as F,A as Y,s as _,j as o,M as S,N as L,B as n,H as l,q as e,u as G,c as C,a6 as J,z as M}from"./BI8qgwQJ.js";import{F as N}from"./DlztlHxj.js";import{F as k}from"./BKM-7Sb9.js";import{M as Q}from"./Bj3Zme3h.js";import{_ as Z}from"./BMR0Rigc.js";import{M as ee}from"./BsBP45q3.js";import"./BTqQ_sdn.js";const te={class:"_gaps_m"},oe=["value"],ie=["value"],ne={class:"_buttons"},se=["all","following","follower","mutualFollow","followingOrFollower","list","never"],ae=x({__name:"notifications.notification-config",props:{value:{},userLists:{},configurableTypes:{}},emits:["update"],setup(T,{emit:m}){const d=T,c=m,R={all:t.ts.all,following:t.ts.following,follower:t.ts.followers,mutualFollow:t.ts.mutualFollow,followingOrFollower:t.ts.followingOrFollower,list:t.ts.userList,never:t.ts.none},r=A(d.value.type),u=A(d.value.type==="list"?d.value.userListId:null);function g(){c("update",r.value==="list"?{type:r.value,userListId:u.value}:{type:r.value})}return(V,p)=>(f(),h("div",te,[i(I,{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=s=>r.value=s)},{default:o(()=>[(f(!0),h(S,null,L(d.configurableTypes??se,s=>(f(),h("option",{key:s,value:s},n(R[s]),9,oe))),128))]),_:1},8,["modelValue"]),r.value==="list"?(f(),F(I,{key:0,modelValue:u.value,"onUpdate:modelValue":p[1]||(p[1]=s=>u.value=s)},{label:o(()=>[l(n(e(t).ts.userList),1)]),default:o(()=>[(f(!0),h(S,null,L(d.userLists,s=>(f(),h("option",{key:s.id,value:s.id},n(s.name),9,ie))),128))]),_:1},8,["modelValue"])):Y("",!0),_("div",ne,[i(q,{inline:"",primary:"",disabled:r.value==="list"&&u.value===null,onClick:g},{default:o(()=>[p[2]||(p[2]=_("i",{class:"ph-check ph-bold ph-lg"},null,-1)),l(" "+n(e(t).ts.save),1)]),_:1,__:[2]},8,["disabled"])])]))}}),le={class:"_gaps_m"},ce={class:"_gaps_s"},re={class:"_gaps_m"},ue={class:"_gaps_m"},fe={class:"_gaps_m"},ye=x({__name:"notifications",async setup(T){let m,d;const c=D(),R=["note","roleAssigned","followRequestAccepted","test","exportCompleted"],r=["app","achievementEarned","login","createToken","scheduledNoteFailed","scheduledNotePosted"],u=G("allowButton"),g=C(()=>u.value?.pushRegistrationInServer),V=C(()=>g.value?.sendReadMessage||!1),p=([m,d]=J(()=>B("users/lists/list")),m=await m,d(),m);async function s(){await y("notifications/mark-all-as-read")}async function O(v,w){await y("i/update",{notificationRecieveConfig:{...c.notificationRecieveConfig,[v]:w}}).then(b=>{c.notificationRecieveConfig=b.notificationRecieveConfig})}function $(v){g.value&&y("sw/update-registration",{endpoint:g.value.endpoint,sendReadMessage:v}).then(w=>{u.value&&(u.value.pushRegistrationInServer=w)})}function P(){B("notifications/test-notification")}async function U(){const{canceled:v}=await W({type:"warning",text:t.ts.resetAreYouSure});v||y("notifications/flush")}return C(()=>[]),C(()=>[]),K(()=>({title:t.ts.notifications,icon:"ph-bell ph-bold ph-lg"})),(v,w)=>{const b=M("SearchKeyword"),X=M("I18n"),E=M("SearchMarker");return f(),F(E,{path:"/settings/notifications",label:e(t).ts.notifications,keywords:["notifications"],icon:"ph-bell ph-bold ph-lg",markerId:"8XIyos6Xv","data-in-app-search-marker-id":"8XIyos6Xv"},{default:o(()=>[_("div",le,[i(ee,{icon:"/client-assets/bell_3d.png",color:"#ffff00"},{default:o(()=>[i(b,null,{default:o(()=>[l(n(e(t).ts._settings.notificationsBanner),1)]),_:1})]),_:1}),i(k,{first:""},{label:o(()=>[l(n(e(t).ts.notificationRecieveConfig),1)]),default:o(()=>[_("div",ce,[(f(!0),h(S,null,L(e(z).filter(a=>!R.includes(a)),a=>(f(),F(Q,{key:a},{label:o(()=>[l(n(e(t).ts._notification._types[a]),1)]),suffix:o(()=>[l(n(e(c).notificationRecieveConfig[a]?.type==="never"?e(t).ts.none:e(c).notificationRecieveConfig[a]?.type==="following"?e(t).ts.following:e(c).notificationRecieveConfig[a]?.type==="follower"?e(t).ts.followers:e(c).notificationRecieveConfig[a]?.type==="mutualFollow"?e(t).ts.mutualFollow:e(c).notificationRecieveConfig[a]?.type==="followingOrFollower"?e(t).ts.followingOrFollower:e(c).notificationRecieveConfig[a]?.type==="list"?e(t).ts.userList:e(t).ts.all),1)]),default:o(()=>[i(ae,{userLists:e(p),value:e(c).notificationRecieveConfig[a]??{type:"all"},configurableTypes:r.includes(a)?["all","never"]:void 0,onUpdate:j=>O(a,j)},null,8,["userLists","value","configurableTypes","onUpdate"])]),_:2},1024))),128))])]),_:1}),i(k,null,{default:o(()=>[_("div",re,[i(N,{onClick:s},{default:o(()=>[l(n(e(t).ts.markAsReadAllNotifications),1)]),_:1})])]),_:1}),i(k,null,{default:o(()=>[_("div",ue,[i(N,{onClick:P},{default:o(()=>[l(n(e(t).ts._notification.sendTestNotification),1)]),_:1}),i(N,{onClick:U},{default:o(()=>[l(n(e(t).ts._notification.flushNotification),1)]),_:1})])]),_:1}),i(k,null,{label:o(()=>[l(n(e(t).ts.pushNotification),1)]),default:o(()=>[_("div",fe,[i(Z,{ref_key:"allowButton",ref:u},null,512),i(H,{disabled:!g.value,modelValue:V.value,"onUpdate:modelValue":$},{label:o(()=>[l(n(e(t).ts.sendPushNotificationReadMessage),1)]),caption:o(()=>[i(X,{src:e(t).ts.sendPushNotificationReadMessageCaption},{emptyPushNotificationMessage:o(()=>[l(n(e(t).ts._notification.emptyPushNotificationMessage),1)]),_:1},8,["src"])]),_:1},8,["disabled","modelValue"])])]),_:1})])]),_:1},8,["label"])}}});
1export{ye 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.