1import{_ as $}from"./DiF7KA75.js";import{a9 as F,aU as A,d as J,a as X,f as j,g as q,X as z,D as Y,w as b,c as g,o,q as c,n as d,j as v,k as s,x as y,U as K,bS as Q,y as T,z as N,r as C,F as E,B as S,bL as w,C as W,i as D,aG as Z,bT as ee,A as te}from"./qBruJ9CT.js";import{s as se}from"./CHDq5FiP.js";import"./MyOTGW5Y.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[t]="4ac9d101-ff04-4f3d-9979-21d856cac648",i._sentryDebugIdIdentifier="sentry-dbid-4ac9d101-ff04-4f3d-9979-21d856cac648")}catch{}})();class ae extends F{getMany(){return this._getMany({url:"/me/notification-settings"})}save(t,n){return this._save({url:"/me/notification-settings",data:n})}delete(t){return this._delete({url:()=>`/me/notification-settings/${t.value}`})}}const ne=new ae;class oe extends F{getManyPaginated(t){return this._getManyPaginated({url:"/me/saved-searches",page:t})}delete(t){return this._delete({url:`/me/saved-searches/${t}`})}}const P=new oe;class ie{async get(){return(await A.get("/me/notification-settings")).data}async set(t){return(await A.post("/me/notification-settings",t)).data}async delete(t){const n=await A.delete(`/me/notification-settings/${t}`);return n.status>=200&&n.status<300}}const R=new ie,re={class:"user-notifications"},le={class:"user-notifications"},ce={key:0,class:"search-saved-list"},de=J({__name:"notifications",async setup(i){let t,n;const{t:r}=X();j({title:r("NOTIFICATIONS_PAGE.TITLE"),meta:[{name:"description",content:r("NOTIFICATIONS_PAGE.DESCRIPTION")}]}),q({ogTitle:r("NOTIFICATIONS_PAGE.TITLE"),ogDescription:r("NOTIFICATIONS_PAGE.DESCRIPTION")});const{$gtag:u}=z(),I=Y(1),{data:h,pending:L}=([t,n]=b(()=>ne.getMany()),t=await t,n(),t),{data:_,pending:M,error:x}=([t,n]=b(()=>P.getManyPaginated(I)),t=await t,n(),t),G=g(()=>{var e;return(e=h.value)==null?void 0:e.filter(l=>l.id!=="saved_searches")}),k=g(()=>{var e;return(e=h.value)==null?void 0:e.filter(l=>l.id==="saved_searches")}),V=g(()=>L.value||M.value);async function B(e){var m;if(await Z({title:r("NOTIFICATIONS_PAGE.DELETE_SAVED_JOB_SEARCH_CONFIRM_MODAL.TITLE"),text:r("NOTIFICATIONS_PAGE.DELETE_SAVED_JOB_SEARCH_CONFIRM_MODAL.TEXT"),confirmButtonLabel:r("YES"),cancelButtonLabel:r("NO")})&&((m=_.value)!=null&&m.items.length)){const f=ee(_.value.items,p=>p.id===e.id);try{P.delete(e.id)}catch{f()}}}function U(e){se(),I.value=e}async function O(e){e.isActive=!e.isActive;try{e.isActive?await R.set(e)?u==null||u.logNotification(e.id,e.isActive):e.isActive=!e.isActive:await R.delete(e.id)?u==null||u.logNotification(e.id,e.isActive):e.isActive=!e.isActive}catch{e.isActive=!e.isActive}}return(e,l)=>{var f;const m=$;return o(),c("div",null,[d(s(y),{as:"h1"},{default:v(()=>[T(N(e.$t("NOTIFICATIONS_PAGE.TITLE")),1)]),_:1}),d(s(y),{type:"body1"},{default:v(()=>[T(N(e.$t("NOTIFICATIONS_PAGE.DESCRIPTION")),1)]),_:1}),d(s(K),{"is-loading":s(V),"has-error":!!s(x)},{default:v(()=>{var p;return[C("ul",re,[(o(!0),c(E,null,S(s(G),a=>(o(),c("li",{key:a.id,class:"user-notifications__notification"},[d(s(w),{label:a.name,"model-value":a.isActive,"onUpdate:modelValue":H=>O(a)},null,8,["label","model-value","onUpdate:modelValue"])]))),128))]),d(s(W)),C("ul",le,[(o(!0),c(E,null,S(s(k),a=>(o(),c("li",{key:a.id,class:"user-notifications__notification"},[d(s(w),{label:a.name,"model-value":a.isActive,"onUpdate:modelValue":H=>O(a)},null,8,["label","model-value","onUpdate:modelValue"])]))),128))]),(p=s(_))!=null&&p.items.length?(o(),c("div",ce,[(o(!0),c(E,null,S(s(_).items,a=>(o(),D(m,{key:a.id,item:a,removable:"",onRemove:B},null,8,["item"]))),128))])):(o(),D(s(y),{key:1,bold:""},{default:v(()=>[T(N(e.$t("NOTIFICATIONS_PAGE.NO_SAVED_SEARCHES_MESSAGE")),1)]),_:1}))]}),_:1},8,["is-loading","has-error"]),d(s(Q),{"number-of-pages":((f=s(_))==null?void 0:f.totalPages)??1,"current-page":s(I),onSetPage:U},null,8,["number-of-pages","current-page"])])}}}),fe=te(de,[["__scopeId","data-v-9b73c80f"]]);export{fe 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.