PageSourceSearch

https://www.injoy-xpress.de/assets/react/notifications-ColdBf9e.js

js injoy-xpress.de collected 2026-10-06 20:06:04 UTC 2,039 bytes, 1 lines download raw bytes

1import{r,R as e}from"./index-BLexuuUs.js";import{u as _}from"./index.esm-CjR1eyLh.js";function j({preferences:u={},whatsApp:c=!1}){const{register:d,handleSubmit:p,formState:{isSubmitting:E}}=_({defaultValues:u,mode:"all"}),[i,m]=r.useState(null),[b,n]=r.useState(!1),g=r.useMemo(()=>({email:"E-Mail",push:"Push",...c?{whatsApp:"WhatsApp"}:{}}),[c]),h=r.useMemo(()=>({ads:"Werbeangebote",system:"Systemnachrichten"}),[]),f=r.useCallback(async t=>{var s,l,o;m(null),n(!1);const a=await fetch("/user/settings",{method:"POST",body:JSON.stringify({notificationPreferences:t,adsOptIn:((s=t.email)==null?void 0:s.ads)||((l=t.push)==null?void 0:l.ads)||((o=t.whatsApp)==null?void 0:o.ads)}),headers:{"Content-Type":"application/json"}});if(a.ok)n(!0);else{const{message:S,messageDE:N}=await a.json();m(N??S)}setTimeout(()=>{n(!1),m(null)},3e3)},[]);return e.createElement("form",{onSubmit:p(f)},e.createElement("div",{"data-grid":"small-gutter"},Object.entries(g).map(([t,a])=>e.createElement("div",{"data-col":"4@sm",key:t},e.createElement("section",{className:"is-padding-middle-1"},e.createElement("dl",{className:"stacked"},e.createElement("dt",null,e.createElement("strong",null,a)),e.createElement("dd",null,e.createElement("div",{className:"field_group is-margin-bottom-1"},Object.entries(h).map(([s,l])=>e.createElement("div",{className:"xui-checkbox is-margin-bottom-1",key:s},e.createElement("input",{type:"checkbox",id:`${t}-${s}`,name:a,...d(`${t}.${s}`)}),e.createElement("label",{htmlFor:`${t}-${s}`,className:"xui-checkbox__label","aria-label":l},l))),t==="push"&&e.createElement("p",{className:"field-group__info is-ink-light"},"Push muss auf dem jeweiligen Gerät aktiviert werden.")))))))),e.createElement("button",{type:"submit",className:"btn btn_small btn_minor",disabled:E},"Speichern"),b&&e.createElement("p",{className:"alert alert_small alert_success is-margin-top-2"},"Einstellungen erfolgreich gespeichert."),!!i&&e.createElement("p",{className:"alert alert_small alert_error is-margin-top-2"},i))}export{j 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.