PageSourceSearch

https://nypost.com/wp-content/plugins/nyp-membership/build/8698.cd9b59dc8e97ff8d3fb3.bundle.min.js

js nypost.com collected 2026-10-01 07:55:26 UTC 14,359 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunknyp_membership=self.webpackChunknyp_membership||[]).push([[1057,8698,9887],{2508:function(e,t,n){var o=n(2001),s=n.n(o),a=n(935),i=n.n(a)()(s());i.push([e.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]),t.A=i},7054:function(e,t,n){var o=n(2591),s=n.n(o),a=n(1740),i=n.n(a),r=n(8128),l=n.n(r),c=n(855),d=n.n(c),u=n(3051),p=n.n(u),m=n(3656),g=n.n(m),h=n(2508),b={};b.styleTagTransform=g(),b.setAttributes=d(),b.insert=l().bind(null,"head"),b.domAPI=i(),b.insertStyleElement=p(),s()(h.A,b),h.A&&h.A.locals&&h.A.locals},2356:function(e,t,n){n.d(t,{d:function(){return a}});var o=n(3486),s=n(8188);const a=e=>{const t=Object.assign({},e);let n=null;return Object.keys(e).forEach(e=>{"password"===e&&t[e].ref.value&&(t[e].message=o.y.passwordRequirements()),"email"===e&&t[e].type===s.lx&&(n=!0)}),{newErrors:t,userExists:n}}},7341:function(e,t,n){n.d(t,{s:function(){return r}});var o=n(1085),s=(n(4041),n(9067)),a=n.n(s),i=n(7309);const r=({message:e="",onClearForm:t=()=>null,submittedEmail:n=!1})=>(0,o.jsx)("div",{role:"alert",className:"error",children:(0,o.jsxs)("span",{children:[e,n?(0,o.jsx)("button",{type:"button",onClick:t,children:(0,i.__)("Try a different email address?","nypost")}):null]})});r.propTypes={message:a().string,submittedEmail:a().bool,onClearForm:a().func}},1057:function(e,t,n){n.r(t),n.d(t,{LoginForm:function(){return j}});var o=n(1085),s=n(4041),a=n(8690),i=n(3657),r=n(7309),l=n(3373),c=n.n(l),d=n(7093),u=n(3486),p=n(7661),m=n(2628),g=n(6381),h=n(316),b=n(7351),w=n(8188),y=n(7296),f=n(7682),v=n(7341),_=n(2356),x=(n(7054),function(e,t,n,o){return new(n||(n=Promise))(function(s,a){function i(e){try{l(o.next(e))}catch(e){a(e)}}function r(e){try{l(o.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,r)}l((o=o.apply(e,t||[])).next())})});const j=()=>{var e,t;const[n,l]=(0,s.useState)(null),[j,C]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!0),{dispatch:L,state:S}=(0,b.rR)(),E=(0,b.Ml)("/account/settings"),{operations:O,state:A}=(0,b.bK)(),{execute:P}=(0,b.Vq)(),F=(0,p.Sh)(S),R=(0,a.Zp)(),I=(()=>{let e,t=!1;return(...n)=>(t||(t=!0,e=(()=>{let e;try{e=new URL(E.includes("https://")?E:`${window.location.origin}${E}`)}catch(e){return void(0,g.z3)([`Error parsing redirect URL: ${E}`,e])}const t=e.pathname===window.location.pathname;window.location.href=E,t&&window.location.reload()})(...n)),e)})();(0,s.useEffect)(()=>(window.addEventListener("nyp-membership:login",I),()=>{window.removeEventListener("nyp-membership:login",I)}),[E]),(0,s.useEffect)(()=>{let e=null;return F&&(e=setTimeout(()=>{(0,g.R8)("Login event not triggered. Redirecting manually.",["nyp-membership","login-form"]),I()},5e3)),()=>clearTimeout(e)},[F]);const J=A.loading||F,B=J?(0,r.__)("Loading...","nypost"):(0,r.__)("Continue","nypost"),W=(0,r.__)("Loading...","nypost"),T=O.register("email",{setValueAs:e=>h.S.plainText(e),required:u.y.validEmail(),pattern:{value:w.Xw,message:u.y.validEmail()}}),{ref:q}=T,G=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(n[o[s]]=e[o[s]])}return n}(T,["ref"]);return(0,o.jsxs)("div",{className:"form-wrapper form-wrapper--login",children:[(0,o.jsxs)("div",{className:"wrapper wrapper--border-top wrapper--thin",children:[(0,o.jsxs)("h1",{className:"form-wrapper__heading m-top-half m-bottom headline",children:[j?null:(0,r.__)("Log in or create account","nypost"),j&&n?(0,r.__)("Create your free account","nypost"):null,j&&!n?(0,r.__)("Log into your account","nypost"):null]}),(0,o.jsxs)("form",{onSubmit:O.handleSubmit(e=>x(void 0,void 0,void 0,function*(){if(A.loading)return;if(O.setLoading(!0),!j){try{yield P()}catch(e){return O.setLoading(!1),void O.setError("email",{type:"recaptcha",message:`Error validating reCAPTCHA: ${e.message||""}`})}const t=yield(0,d.v9)(e.email);return l(!t),C(!0),void O.setLoading(!1)}if(n){const t=yield(0,d.kz)({email:A.username,password:e.password,skipForeignKey:!N});if(!t)return O.setLoading(!1),void O.setGeneralRegistrationError();const{status:o,type:s="",sessionId:a="",trackingId:i=""}=t;if("failed"===o&&s===w.lx)return O.setLoading(!1),void O.setError("email",{type:w.lx},{shouldFocus:!1});if("failed"===o&&s===w.Js){const e=localStorage.getItem("nyp_id"),t=e?yield(0,d.PB)(e):null;return k(!1),O.setLoading(!1),void O.setError("email",{type:w.Js,message:u.y.nypIdInUse(t)},{shouldFocus:!1})}return"success"===o&&(L((0,p.m)(A.username)),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"user-registration"})),a&&"false"!==a&&i&&((0,m.A)(),yield O.onSuccessfulLogin(a,i),"success"===o)?void R(w.iF):(yield(0,d.Rv)({email:A.username,action:n?"register":"login",redirect:"/account/settings"}).catch(e=>{O.setError("zephr",{type:"zephr",message:`Error sending verification email: ${e.message||""}`})}))?"success"===o?void R("/account/continue-passwordless-registration"):void O.setGeneralError():void O.setLoading(!1)}const t={email:A.username,password:e.password},o=yield(0,d.iD)(t);if(O.setLoading(!1),!o)return void O.setGeneralError();const{sessionId:s=!1,status:a="failed",trackingId:i=!1,type:r=""}=o;if("failed"===a){let e="",t="zephr";switch(r){case"email-not-verified":e=u.y.emailVerified(),t=r,(0,d.Rv)({email:A.username,action:"register",redirect:"/account/verify"}).catch(e=>{O.setError("email",{type:"zephr",message:`Error sending verification email: ${e.message||""}`})});break;
1case"user-not-found":case"invalid-password":e=u.y.wrongEmailPassword(),t="wrong-email-password";break;default:e=u.y.unknownError()}return void(e&&O.setError("email",{type:t,message:e}))}"success"!==a?O.setGeneralError():yield O.onSuccessfulLogin(s,i)})),children:[(0,o.jsxs)("div",{className:"floating-label input-container input-container--floating-label",children:[(0,o.jsx)("input",Object.assign({className:c()("floating-label__input",{"input-error":null===(e=A.errors)||void 0===e?void 0:e.email}),id:"email","data-testid":"email"},G,{ref:e=>{A.email.current=e,q(e)},placeholder:" ",required:!0,type:"email",disabled:J||A.loading||j||A.loadingContinueWithoutPassword,"data-empty":!A.username})),(0,o.jsx)("div",{className:"floating-label__label-wrap",children:(0,o.jsx)("label",{className:"floating-label__label",htmlFor:"email",children:(0,r.__)("Email Address","nypost")})})]}),j?(0,o.jsxs)("div",{className:"floating-label input-container input-container--floating-label",children:[(0,o.jsx)("label",{htmlFor:"password",className:"screen-reader-text",children:(0,r.__)("Password","nypost")}),(0,o.jsx)("input",Object.assign({className:c()("floating-label__input",{"input-error":null===(t=A.errors)||void 0===t?void 0:t.password}),id:"password","data-testid":"password",name:"password",placeholder:" "},O.register("password",n?{setValueAs:e=>h.S.plainText(e),required:u.y.enterPassword(),minLength:8,validate:e=>w.QR.test(e)}:{required:u.y.enterPassword()}),{type:"password",required:!0,disabled:J||A.loading||A.loadingContinueWithoutPassword,"data-empty":!A.password})),(0,o.jsx)("div",{className:"floating-label__label-wrap",children:(0,o.jsx)("label",{className:"floating-label__label",htmlFor:"email",children:(0,r.__)("Password","nypost")})}),(0,o.jsx)("button",{className:"visibility-toggle",type:"button","aria-label":(0,r.__)("Show or hide your password","nypost"),onClick:y.k})]}):null,(0,o.jsx)(f.dF,{errors:n?(0,_.d)(A.errors).newErrors:A.errors,customMessage:e=>(0,o.jsx)(v.s,Object.assign({onClearForm:()=>{l(null),C(!1),O.clearErrors()},submittedEmail:j},e))}),!n&&j?(0,o.jsx)("p",{className:"form-text form-text--forgot",children:(0,o.jsx)(i.N_,{to:"/account/forgot-password",children:(0,r.__)("Forgot your password?","nypost")})}):null,(0,o.jsx)("div",{className:"input-container",children:(0,o.jsx)("input",{className:c()({disabled:J||A.loading||A.loadingContinueWithoutPassword}),"data-testid":"login-submit",disabled:J||A.loading||A.loadingContinueWithoutPassword,type:"submit",value:B})})]}),j?null:(0,o.jsxs)("div",{className:"third-party-wrapper",children:[(0,o.jsx)("div",{className:"button-wrap-lines button-wrap-lines--divider",children:(0,o.jsx)("div",{className:"button-wrap-lines__inner",children:(0,o.jsx)("span",{children:(0,r.__)("Social Sign In","nypost")})})}),(0,o.jsxs)("button",{className:"button button--secondary button--social",type:"button",onClick:O.onSocialClick("google"),disabled:J||"google"===A.loadingSocial,"data-ga-event":JSON.stringify({category:"Login to your account",action:"Button Click: Continue with Google",label:"Continue with Google"}),"data-ga4-event":JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue with Google"}),children:[(0,o.jsx)("span",{className:"icon-google"}),"google"===A.loadingSocial?W:(0,r.__)("Continue with Google","nypost")]}),(0,o.jsxs)("button",{className:"button button--secondary button--social",type:"button",onClick:O.onSocialClick("facebook"),disabled:J||"facebook"===O.loadingSocial,"data-ga-event":JSON.stringify({category:"Login to your account",action:"Button Click: Continue with Facebook",label:"Continue with Facebook"}),"data-ga4-event":JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue with Facebook"}),children:[(0,o.jsx)("span",{className:"icon-facebook"}),"facebook"===A.loadingSocial?W:(0,r.__)("Continue with Facebook","nypost")]}),(0,o.jsxs)("button",{className:"button button--secondary button--social",type:"button",onClick:O.onSocialClick("apple"),disabled:J||"apple"===A.loadingSocial,"data-ga-event":JSON.stringify({category:"Login to your account",action:"Button Click: Continue with Apple",label:"Continue with Apple"}),"data-ga4-event":JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue with Apple"}),children:[(0,o.jsx)("span",{className:"icon-apple"}),"apple"===A.loadingSocial?W:(0,r.__)("Continue with Apple","nypost")]})]}),j&&window.nypMembership.featureFlags.passwordless?(0,o.jsxs)("div",{className:"continue-without-password",children:[(0,o.jsx)("div",{className:"button-wrap-lines button-wrap-lines--div
1ider",children:(0,o.jsx)("div",{className:"button-wrap-lines__inner",children:(0,o.jsx)("span",{children:(0,r.__)("Or","nypost")})})}),(0,o.jsx)("button",{className:c()({"button button--secondary button--continue-without-password m-bottom-half t-uppercase":!0,disabled:J||A.loadingContinueWithoutPassword}),type:"button",onClick:()=>O.onContinueWithoutPassword(n).then(e=>e&&R(n?"/account/continue-passwordless-registration":"/account/continue-passwordless")),disabled:J||A.loadingContinueWithoutPassword,"data-testid":"continue-without-password","data-ga-event":JSON.stringify({category:"Login to your account",action:"Button Click: Continue without password",label:"Continue without password"}),"data-ga4-event":JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue without password"}),children:A.loadingContinueWithoutPassword?W:(0,r.__)("Continue without password","nypost")})]}):null,j||n?null:(0,o.jsx)(f.XN,{className:"form-text form-text--terms",html:u.p.forRegisterAccount(j?["Continue","Continue Without Password"]:["Continue","Continue With"]),tagName:"p",addAttr:["target"]})]}),j||n?null:(0,o.jsx)(f.uu,{children:(0,o.jsx)("div",{className:"wrapper wrapper--thin wrapper--border-top home-delivery-login",children:(0,o.jsx)(f.np,{gaCategory:"Login Page"})})})]})}},7296:function(e,t,n){n.d(t,{k:function(){return o}});const o=e=>{const t=e.target;if(!t.classList.contains("visibility-toggle"))return;const n=t.closest(".input-container").querySelector("#password");n.classList.contains("toggled")?(t.classList.remove("visible"),n.classList.remove("toggled"),n.setAttribute("type","password")):(t.classList.add("visible"),n.classList.add("toggled"),n.setAttribute("type","text"))}},8698:function(e,t,n){n.r(t),n.d(t,{LoginModal:function(){return i}});var o=n(1085),s=n(1057),a=n(2662);const i=()=>(0,o.jsx)(a.l,{modalName:"Log In",children:(0,o.jsx)(s.LoginForm,{})})},9887:function(e,t,n){n.r(t),n.d(t,{Modal:function(){return u}});var o=n(1085),s=n(4041),a=n(7309),i=n(3373),r=n.n(i),l=n(9882),c=n(7682),d=n(7351);const u=({children:e,isOpen:t=!0,modalClass:n="",modalName:i="",disableOutsideClick:u=!1,onClose:p=()=>null})=>{const m=(0,s.useRef)(),[g,h]=(0,s.useState)(!1);if((0,s.useEffect)(()=>h(t),[t]),(0,d.jz)(m,()=>{u||p&&t&&p()}),(0,l.Q)({"membership-modal-open":g}),!e)return null;if(!g)return null;const b=()=>{window.location.search.includes("welcome=true")&&(window.history.replaceState({},document.title,window.location.pathname),window.location.reload()),h(!g),p&&"function"==typeof p&&p()},w=i?{"aria-label":i}:{"aria-labelledby":"modal-title"};return(0,o.jsx)(c.ZL,{portalRoot:document.body,children:(0,o.jsx)("div",{className:"membership-modal-overlay",children:(0,o.jsxs)("div",Object.assign({"aria-hidden":!g,"aria-modal":"true"},w,{className:r()("membership-modal",n),"data-testid":"membership-modal",ref:m,role:"dialog",children:[(0,o.jsx)(()=>(0,o.jsxs)("span",{className:"membership-modal__close","data-testid":"closeButton",role:"button",onClick:b,onKeyDown:b,tabIndex:0,"data-ga4-event":JSON.stringify({event_name:"ux_engagement",source_unit:"onboarding",event_action:`${i}_close`}),children:[(0,o.jsx)("span",{className:"icon close-button-black"}),(0,o.jsx)("span",{className:"screen-reader-text",children:(0,a.__)("Close modal","nypost")})]}),{}),(0,o.jsx)("div",{className:"membership-modal__content",children:e})]}))})})}},2662:function(e,t,n){n.d(t,{l:function(){return c}});var o=n(1085),s=n(8690),a=n(9089),i=n(1903),r=n(8357),l=n(9887);const c=({children:e,modalName:t="",disableOutsideClick:n=!1,onClose:c=()=>null})=>{const d=(0,s.Zp)(),{state:{redirect:u}}=(0,r.r)();return(0,o.jsx)(a.L,{children:(0,o.jsx)(l.Modal,{onClose:()=>{(0,i.A)()?window.location.href=u&&"/account/subscribe"!==u?u:"/sports-plus/":d("/"),c()},modalName:t,disableOutsideClick:n,children:e})})}}}]);
2//# sourceMappingURL=8698.cd9b59dc8e97ff8d3fb3.bundle.min.js.map

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.