PageSourceSearch

https://app.sepaheld.com/assets/index-CkvM8BzG.js

js sepaheld.com collected 2026-10-06 11:11:34 UTC 5,890 bytes, 6 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6cb7470b-8718-5227-8147-81a82d69bc66")}catch(e){}}();
3import{g as R,q as U,N as B,e as L,r as i,j as e,M as t,c as d}from"./index-Cx6kJl1r.js";function k(l){if(!l)throw new Error("customerId is required to load email subscription preferences");return`public/customers/${encodeURIComponent(l)}/email/subscription`}function M(l){return new Promise((u,r)=>{R(k(l),{checkAuthorization:!1,publicRequest:!0}).then(c=>{u(c.data)}).catch(c=>{r(c)})})}function Y(l,u){return new Promise((r,c)=>{U(k(l),u,{checkAuthorization:!1,publicRequest:!0}).then(o=>{r(o.data)}).catch(o=>{c(o)})})}const H="_wrapper_1tygn_1",z="_card_1tygn_9",D="_gradientCard_1tygn_16",K="_gradientCardHeader_1tygn_21",O="_gradientCardBody_1tygn_33",T="_cardAlert_1tygn_47",W="_form_1tygn_56",Q="_switchRow_1tygn_60",$="_loadingState_1tygn_82",G="_formActions_1tygn_95",J="_submitButton_1tygn_101",V="_buttonSpinner_1tygn_122",s={wrapper:H,card:z,gradientCard:D,gradientCardHeader:K,gradientCardBody:O,cardAlert:T,form:W,switchRow:Q,loadingState:$,formActions:G,submitButton:J,buttonSpinner:V},h={marketing:!1,productUpdates:!1,summaryFrequency:"WEEKLY"},X=[{value:"NONE",labelId:"email.subscription.form.summaryFrequency.none"},{value:"DAILY",labelId:"email.subscription.form.summaryFrequency.daily"},{value:"WEEKLY",labelId:"email.subscription.form.summaryFrequency.weekly"}],ee=()=>{const{customerId:l}=B(),[u]=L(),[r,c]=i.useState(void 0),[o,g]=i.useState(void 0),[f,x]=i.useState(!1),[y,j]=i.useState(!1),[E,v]=i.useState(void 0),[C,p]=i.useState(void 0),[F,b]=i.useState(!1),P=u.get("customerId"),N=(l||P||"").trim(),n=N.length>0?N:void 0,q=i.useMemo(()=>!r||!o?!1:r.marketing!==o.marketing||r.productUpdates!==o.productUpdates||r.summaryFrequency!==o.summaryFrequency,[o,r]),_=i.useCallback(a=>m=>{c(I=>({...I||h,[a]:m.target.checked})),b(!1),p(void 0)},[]),w=i.useCallback(a=>({marketing:!!a?.marketing,productUpdates:!!a?.productUpdates,summaryFrequency:a?.summaryFrequency||"WEEKLY"}),[]),S=i.useCallback(async()=>{if(n){x(!0),v(void 0),b(!1);try{const a=await M(n),m=w(a||h);c(m),g(m)}catch(a){v(a),c(h),g(h)}finally{x(!1)}}},[n,w]);i.useEffect(()=>{S()},[S]);const A=i.useCallback(async a=>{if(a.preventDefault(),!(!n||!r)){j(!0),p(void 0);try{await Y(n,r),g(r),b(!0)}catch(m){p(m)}finally{j(!1)}}},[n,r]);return e.jsx("div",{className:s.wrapper,children:e.jsx("div",{className:"container",children:e.jsx("div",{className:"row justify-content-center",children:e.jsx("div",{className:"col-lg-6 col-md-8 col-sm-10 col-12",children:e.jsxs("div",{className:d(s.card,s.gradientCard,"card border-0"),children:[e.jsxs("div",{className:s.gradientCardHeader,children:[e.jsx("h1",{className:"h4 mb-2",children:e.jsx(t,{id:"email.subscription.page.title"})}),e.jsx("p",{className:"mb-0",children:e.jsx(t,{id:"email.subscription.page.intro"})})]}),e.jsxs("div",{className:d("card-body",s.gradientCardBody),children:[!n&&e.jsx("div",{className:d("alert alert-warning",s.cardAlert),children:e.jsx(t,{id:"email.subscription.missing.customer"})}),n&&E&&e.jsx("div",{className:d("alert alert-danger",s.cardAlert),children:e.jsx(t,{id:"email.subscription.error.loading"})}),n&&F&&e.jsx("div",{className:d("alert alert-success",s.cardAlert),children:e.jsx(t,{id:"email.subscription.success"})}),n&&C&&e.jsx("div",{className:d("alert alert-danger",s.cardAlert),children:e.jsx(t,{id:"email.subscription.error.saving"})}),n&&e.jsxs("form",{onSubmit:A,className:s.form,children:[e.jsxs("fieldset",{disabled:f,children:[e.jsxs("div",{className:s.switchRow,children:[e.jsxs("div",{children:[e.jsx("h2",{className:"h6 mb-1",children:e.jsx(t,{id:"email.subscription.form.marketing"})}),e.jsx("p",{className:"mb-0",children:e.jsx(t,{id:"email.subscription.form.marketing.hint"})})]}),e.jsx("div",{className:"form-check form-switch",children:e.jsx("input",{className:"form-check-input",type:"checkbox",role:"switch",id:"marketing",checked:!!r?.marketing,onChange:_("marketing")})})]}),e.jsxs("div",{className:s.switchRow,children:[e.jsxs("div",{children:[e.jsx("h2",{className:"h6 mb-1",children:e.jsx(t,{id:"email.subscription.form.productUpdates"})}),e.jsx("p",{className:"mb-0",children:e.jsx(t,{id:"email.subscription.form.productUpdates.hint"})})]}),e.jsx("div",{className:"form-check form-switch",children:e.jsx("input",{className:"form-check-input",type:"checkbox",role:"switch",id:"productUpdates",checked:!!r?.productUpdates,onChange:_("productUpdates")})})]}),e.jsx("div",{className:s.switchRow,children:e.jsxs("div",{style:{flex:1},children:[e.jsx("h2",{className:"h6 mb-1",children:e.jsx(t,{id:"email.subscription.form.summaryFrequency"})}),e.jsx("p",{className:"mb-2",children:e.jsx(t,{id:"email.subscription.form.summaryFrequency.hint"})}),e.jsx("div",{className:"d-flex gap-2",children:X.map(a=>e.jsx("button",{type:"button",className:d("btn btn-sm",r?.summaryFrequency===a.value?"btn-primary":"btn-outline-secondary"),onClick:()=>{c(m=>({...m||h,summaryFrequency:a.value})),b(!1),p(void 0)},children:e.jsx(t,{id:a.labelId})},a.value))})]})})]}),f&&e.jsxs("div",{className:s.loadingState,children:[e.jsx("div",{className:"spinner-border spinner-border-sm",role:"status"}),e.jsx("span",{children:e.jsx(t,{id:"email.subscription.loading"})})]}),e.jsx("div",{className:s.formActions,children:e.jsxs("button",{type:"submit",className:d("btn btn-light",s.submitButton),disabled:y||f||!q,children:[y&&e.jsx("span",{className:d("spinner-border spinner-border-sm",s.buttonSpinner),role:"status"}),e.jsx(t,{id:"email.subscription.form.submit"})]})})]})]})]})})})})})};export{ee as default};
4//# sourceMappingURL=index-CkvM8BzG.js.map
5
6//# debugId=6cb7470b-8718-5227-8147-81a82d69bc66

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.