PageSourceSearch

https://dz.diesel.com/on/demandware.static/Sites-DieselWW-Site/-/e…/js/component-Login.chunks.js

js diesel.com collected 2026-09-24 08:43:15 UTC 8,170 bytes, 1 lines download raw bytes

1(self.webpackChunkapp_project=self.webpackChunkapp_project||[]).push([[7020,5645],{6583:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>i});const r=o(8563).N,a=o(14863).ZP,n=o(38302).default;class i extends n{constructor(e){super(e),this.form=e,this.formData={},this.url=new URL(this.action(),window.location.origin),this.isSubmitting=!1,this.setup()}setup(){this.form.addEventListener("submit",(e=>{e.preventDefault(),this.submitHandler()})),[...this.form.querySelectorAll('[type="submit"]')].forEach((e=>{e.addEventListener("click",(e=>{this.isSubmitting=!0}))})),this.form.addEventListener("invalid",(e=>{this.isSubmitting&&(this.focusOnInvalidInput(),this.isSubmitting=!1)}),!0)}focusOnInvalidInput(e){if((e=e||this.form.querySelector("input:invalid, textarea:invalid, select:invalid"))&&document.activeElement!==e){e.focus({preventScroll:!0});let t=e.getBoundingClientRect(),o=window.scrollY+t.top-window.innerHeight/3;window.scrollTo({top:o,behavior:"auto"})}console.log("Focus on first invalid input:",e)}loadRecaptchaScript(e){const t=document.querySelector("#recaptcha-script");if(!t)return void(document.querySelector('script[src*="recaptcha"]')&&(this.recaptchaScriptLoaded=!0));const o=()=>{t.getAttribute("src")||(t.setAttribute("src",t.dataset.src),t.async=!0,t.onload=()=>{document.dispatchEvent(new CustomEvent("recaptcha-loaded"))},this.recaptchaScriptLoaded=!0)};e?o():this.recaptchaFocusBound||(this.form.addEventListener("mouseenter",o,{once:!0}),this.form.addEventListener("focusin",o,{once:!0}),this.form.addEventListener("click",o,{once:!0}),this.recaptchaFocusBound=!0)}getRecaptchaToken(e){const t=this.element.querySelector('input[name="googleRecaptchaClientSide"]'),o=this.element.querySelector('input[name="googleRecaptchaToken"]');if(!t)return;const r=()=>{window.grecaptcha.ready((()=>{this.performRecaptchaCall=async()=>window.grecaptcha.execute(t.value,{action:e}).then((e=>(o.value=e,e)))}))};window.grecaptcha?r():(document.addEventListener("recaptcha-loaded",(()=>{console.log("Lazy loading recaptcha."),r()}),{once:!0}),this.loadRecaptchaScript(!1))}action(){return this.form.getAttribute("action")}method(){return this.form.getAttribute("method")}async submitHandler(){this.isSubmitting=!0,this.url=new URL(this.action(),window.location.origin);const e=new CustomEvent("beforeSubmit",{bubbles:!0,cancelable:!0,composed:!1});this.form.dispatchEvent(e),this.performRecaptchaCall&&await this.performRecaptchaCall(),this.formData=r(this.form);const t={method:this.method()};if("get"===this.method().toLowerCase()){const e={},t=new FormData(this.form);for(const o of t.keys())e[o]=t.get(o);this.url.search=new URLSearchParams(e).toString()}else t.body=new FormData(this.form);a("".concat(this.url),t).then((e=>{const t=e.headers.get("content-type");if(!t)throw new TypeError("No content type defined in response/header");return t.includes("application/json")?e.json():t.includes("text/html")?e.text():void 0})).then((e=>{const o=new CustomEvent("data",{detail:{body:t.body,data:e},bubbles:!0,cancelable:!0,composed:!1});this.form.dispatchEvent(o)})).catch((e=>{console.error(e);const t=new CustomEvent("error",{detail:{data:e},bubbles:!0,cancelable:!0,composed:!1});this.form.dispatchEvent(t)}))}}},23014:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>i});var r=o(12737),a=o(14863);const n=o(6583).default;class i extends n{constructor(e){if(super(e),this.errorHolder=this.form.querySelector(".form-error"),this.form.dataset.socialEmail&&this.form.dataset.isSocialRegError){this.socialEmail=this.form.dataset.socialEmail,this.isSocialRegError=this.form.dataset.isSocialRegError,this.isSocialRegErrorMsg=this.form.dataset.isSocialRegErrorMsg,this.errorHolder.innerHTML=this.isSocialRegErrorMsg,this.errorHolder.classList.remove("d-none"),this.form.querySelector("#login-form-email").value=this.socialEmail;const e=window.location.origin+window.location.pathname;history.replaceState(null,"",e),this.form.removeAttribute("data-social-email"),this.form.removeAttribute("data-is-social-reg-error"),this.form.removeAttribute("data-is-social-reg-error-msg")}this.form.addEventListener("beforeSubmit",(e=>{utag.data.page_type="menu_header:login_cta",utag.data.event_name="login_cta_click",utag.link(utag.data),r.Z.emit("body:loading"),this.errorHolder&&this.errorHolder.classList.add("d-none")})),this.form.addEventListener("data",(e=>{const t=e.detail.data;!t.success&&t.journeyMsg?this.element.querySelector(".login-modal__store").innerHTML=t.journeyMsg:t.error&&t.socialAccountAlreadyExists?(e.target.parentElement.classList.contains("login-form")?this.showTransferAccountPanel(t.error[0],t.socialEmail):e.target.parentElement.classList.contains("form-login-wrapper")?this.changeLoginForm(e.target,t.error[0],t.socialEmail,"login-page"):e.target.parentElement.classList.contains("checkout-login-form-container")&&this.changeLoginForm(e.target,t.error[0],t.socialEmail,"checkout-page"),r.Z.emit("body:loaded")):t.error?(this.errorHolder&&(this.errorHolder.innerHTML=t.error[0],this.errorHolder.classList.remove("d-none")),r.Z.emit("body:loaded")):(this.errorHolder&&this.errorHolder.classList.add("d-none"),$body&&($body.trigger("user:loggedIn"),$body.trigger("customer:updateAttributes")),document.querySelector(".product-detail.product-wrapper")||document.querySelector(".cart-container .cart"),window.location.reload()),t.redirectUrl||r.Z.emit("body:loaded")})),this.precheckRemberMe(),this.trackingButtonGoogleLogin(),this.trackingButtonAppleLogin(),this.trackingButtonRegisterMenu()}async getCsfrToken(){const e=this.element.dataset.csfrurl;if(!e)return{};const t=await(0,a.ZP)(e,{method:"POST"}),{csrf:o}=await t.json(),{tokenName:r,token:n}=o,i=this.element.querySelector('[name="'.concat(r,'"]'));i&&(i.value=n)}async precheckRemberMe(){const e=this.element.querySelector('[name="loginRememberMe"]');e&&(e.checked=!0)}trackingButtonGoogleLogin(){const e=document.querySelector(".google-button-login");e&&e.addEventListener("click",(()=>{utag.data.page_type="menu_header:login_cta",utag.data.event_name="login_google_click",utag.link(utag.data)}))}trackingButtonAppleLogin(){const e=document.querySelector(".oauth-button--apple div");e&&e.addEventListener("click",(()=>{utag.data.page_type="menu_header:login_cta",utag.data.event_name="login_apple_click",utag.link(utag.data)}))}trackingButtonRegisterMenu(){const e=document.querySelector("[data-create-account]");e&&e.addEventListener("click",(()=>{utag.data.page_type="menu_header:register_cta",utag.data.event_name="register_new_account",utag.link(utag.data)}))}showTransferAccountPanel(e,t){const o=document.getElementById("account-navbar");
1if(o){o.classList.add("show-transfer-social-account");const r=o.querySelector(".transfer-social-account-panel");if(r){r.querySelector('[data-user-action="back"]').addEventListener("click",(e=>{e.preventDefault(),o.classList.remove("show-transfer-social-account")})),r.querySelector("form.login");const a=r.querySelector(".form-error"),n=r.querySelector("#social-email");a.innerHTML=e,n.value=t}}}changeLoginForm(e,t,o,r){e.classList.add("d-none");const a=document.getElementById("transfer-social-account-form");if(a){a.classList.remove("d-none");const n=document.getElementById("social-form-back"),i="checkout-page"===r?document.querySelector(".login-box .section-text"):null,s="checkout-page"===r?document.querySelector(".login-box .wrapped-actions-login .cta"):null;n&&(i&&s&&(i.classList.add("d-none"),s.classList.add("d-none")),n.parentElement.classList.remove("d-none"),n.addEventListener("click",(t=>{t.preventDefault(),e.classList.remove("d-none"),a.classList.add("d-none"),n.parentElement.classList.add("d-none"),i&&s&&(i.classList.remove("d-none"),s.classList.remove("d-none"))})));const c=a.querySelector(".form-error"),l=a.querySelector("#social-login-form-email");c.innerHTML=t,l.value=o}}async submitHandler(){await this.getCsfrToken(),super.submitHandler()}}},8563:(e,t,o)=>{"use strict";function r(e){const t={};return[...new FormData(e).entries()].forEach((e=>{if(t[e[0]]){let o;"string"==typeof t[e[0]]?o=[t[e[0]],e[1]]:Array.isArray(t[e[0]])&&(o=t[e[0]].push(e[1])),t[e[0]]=o}else t[e[0]]=e[1]})),t}o.d(t,{N:()=>r})}}]);

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.