PageSourceSearch

https://www.parship.de/wplp/wp-content/plugins/psg-registration-fo…/dist/js/registration-form.js?ver=2.20.9

js parship.de collected 2026-10-01 11:44:37 UTC 19,904 bytes, 2 lines download raw bytes

1(function(){var e=class{static isValidEmail(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/g.test(e)}static isValidPasswordLength(e){return e.length>=8}static hasLettersAndNumbers(e){let t=/.*[a-zA-Z]+.*/g.test(e),n=/.*[0-9]+.*/g.test(e),r=/.*[^a-zA-Z0-9\s]+.*/g.test(e);return t&&(n||r)}static isNotPartOfEmail(e,t){let n=e.split(`@`)[0];return t.length>0&&(n===``||!t.includes(n))}static isInputChecked(e,t){return t.querySelector(`input[name="`+e+`"]:checked`)!==null}},t=class{static getCategory(){switch(document.body.id){case`homepage`:return`homepage`;case`landing-page`:return`landing-page`;default:return`editorial`}}static trackUIEvent(e,t,n,r=``,i=``,a=``){let o={category:this.getCategory(),subcategory:e,targetId:t,action:n,cd1:r,cd2:i,cd3:a};document.dispatchEvent(new CustomEvent(`pegLogger-logWpEvents`,{detail:o}))}},n=class n{constructor(e,t,n,r,i){this.form=e,this.usePreselect=t,this.isHetero=n,this.isOptional=r,this.inputCallback=i,this.inputContainer=this.form.querySelector(`.gender-select`),this.onlySearchGenderSelect=this.form.classList.contains(`search-gender-select`),this.uiTrackingEnabled=this.form.dataset.biEnabled===`true`,this.errorCount=0,this.getDomElements(),this.setEventListener(),this.initUiTracking()}getMysexSelection(){let e=Array.from(this.mysexInputs).find(e=>e.checked);return{mySex:e?.value??``,gender:e?.dataset.gender??``}}static essexFromSingleChoice(e){let t=e.find(e=>e.checked);return{esSex:t?.value??``,searchGenders:t?.searchGenders??``}}static essexFromMultipleChoice(e){let t=e.filter(e=>e.checked);if(t.length===0)return{esSex:``,searchGenders:``};let n=e.find(e=>e.name===`essexW`),r=e.find(e=>e.name===`essexM`),i=t.map(e=>e.searchGenders).join(`,`);return n?.checked&&r?.checked?{esSex:`3`,searchGenders:i}:n?.checked?{esSex:n.value,searchGenders:i}:{esSex:r?.value??``,searchGenders:i}}getEssexSelection(){let e=Array.from(this.esSexInputs).map(e=>({name:e.name,value:e.value,searchGenders:e.dataset.gender??``,checked:e.checked}));return this.onlySearchGenderSelect?n.essexFromSingleChoice(e):n.essexFromMultipleChoice(e)}getEssexValue(){return this.getEssexSelection().esSex}writeSelectionToHiddenFields(){let{esSex:e,searchGenders:t}=this.getEssexSelection();this.essex.value=e,this.searchGenders.value=t}getSearchGenders(){return this.getEssexSelection().searchGenders}enableUi(){this.inputContainer.inert=!1}isValidSex(){let t=this.onlySearchGenderSelect?!0:e.isInputChecked(`mysex`,this.form),n=this.getEssexValue()!==``;return t&&n}validate(){if(this.isOptional)return!0;let e=this.isValidSex();return e||(this.showError(),this.uiTrackingEnabled&&(t.trackUIEvent(`registration-form`,`form`,`validation-error`,`gender-select`,this.errorCount.toString()),this.errorCount++)),e}getSelectedSex(){let{mySex:e,gender:t}=this.getMysexSelection(),{esSex:n,searchGenders:r}=this.getEssexSelection();return{mySex:e,gender:t,esSex:n,searchGenders:r}}getDomElements(){this.mysexInputs=this.form.querySelectorAll(`input[name=mysex]`),this.esSexInputs=this.form.querySelectorAll(`.essex-input`),this.essex=this.form.querySelector(`[name=essex]`),this.searchGenders=this.form.querySelector(`[name=searchGenders]`),this.errorMessage=this.form.querySelector(`.gender-error`)}setEventListener(){this.esSexInputs.forEach(e=>{e.addEventListener(`click`,e=>this.onEssexInput(e))}),[...this.mysexInputs,...this.esSexInputs].forEach(e=>{e.addEventListener(`change`,e=>this.onSexInput(e))})}onEssexInput(e){if(!this.onlySearchGenderSelect&&this.getEssexValue()===``){e.preventDefault(),e.stopPropagation();return}this.esSexInputs.forEach(e=>{e.removeAttribute(`aria-required`)}),this.writeSelectionToHiddenFields()}onSexInput(e){this.usePreselect&&!this.isValidSex()&&this.preSelectSex(e),this.writeSelectionToHiddenFields(),this.isValidSex()&&this.hideError(),this.inputCallback()}preSelectSex(e){let t=e.target,n;n=t.name===`mysex`?this.isHetero?t.value===`1`?`input[name="essexM"]`:`input[name="essexW"]`:t.value===`1`?`input[name="essexW"]`:`input[name="essexM"]`:this.isHetero?t.value===`1`?`input[name="mysex"][value="
10"]`:`input[name="mysex"][value="1"]`:t.value===`0`?`input[name="mysex"][value="0"]`:`input[name="mysex"][value="1"]`;let r=this.form.querySelector(n);r.checked=!0}showError(){this.errorMessage.classList.add(`is-visible`),this.errorMessage.textContent=this.errorMessage.dataset.errorText}hideError(){this.errorMessage.textContent=``,this.errorMessage.classList.remove(`is-visible`)}initUiTracking(){this.uiTrackingEnabled&&(this.mysexInputs.forEach(e=>{e.addEventListener(`change`,e=>{let n=e.target;t.trackUIEvent(`registration-form`,`gender-select`,e.type,`mysex`,n.dataset.gender||n.value)},{once:!0})}),this.esSexInputs.forEach(e=>{e.addEventListener(`change`,e=>{t.trackUIEvent(`registration-form`,`gender-select`,e.type,`essex`,this.getSearchGenders())},{once:!0})}))}},r=class{constructor(e,t,n){this.form=e,this.genderSelect=t,this.dynamicConf=n,this.uiTrackingEnabled=this.form.dataset.biEnabled===`true`,this.inputContainer=this.form.querySelector(`.social-sign-on`),this.dynamicConf?.apple.isRegistrationAllowed&&this.form.querySelector(`.apple-reg-container`)!==null&&(this.appleRegButton=this.form.querySelector(`.apple-reg-button a`),this.appleRegButton?.addEventListener(`click`,e=>this.onSocialLinkClicked(e)),this.form.querySelector(`.social-sign-on-separator`)?.classList.add(`is-visible`),this.form.querySelector(`.apple-reg-container`)?.classList.add(`is-visible`)),this.dynamicConf?.google?.isRegistrationAllowed&&this.form.querySelector(`.google-reg-container`)!==null&&(this.googleRegButton=this.form.querySelector(`.google-reg-button`),this.googleRegButton.addEventListener(`click`,e=>{this.onSocialLinkClicked(e)}),this.form.querySelector(`.social-sign-on-separator`)?.classList.add(`is-visible`),this.form.querySelector(`.google-reg-container`)?.classList.add(`is-visible`),this.setGoogleButtonHref(null)),this.initUiTracking()}onSocialLinkClicked(e){this.genderSelect&&!this.genderSelect.validate()&&e.preventDefault()}setAppleButtonHref(e){if(!this.appleRegButton||!this.dynamicConf.apple.isRegistrationAllowed)return;let t=encodeURIComponent(`${this.dynamicConf.apple.callbackDomain}/appleCallback`),n=`action=reg&oid=${this.dynamicConf.ownerId}&search=${e.mySex+e.esSex}`;this.dynamicConf.apple.socialProviderState?.length&&(n+=`&socialProviderState=${this.dynamicConf.apple.socialProviderState}`);let r=encodeURIComponent(n);this.appleRegButton.href=`https://appleid.apple.com/auth/authorize?client_id=${this.dynamicConf.apple.clientId}&redirect_uri=${t}&response_type=code%20id_token&response_mode=form_post&scope=email%20name&state=${r}`}setGoogleButtonHref(e){if(!this.googleRegButton)return;let t=new URL(`https://accounts.google.com/o/oauth2/v2/auth`);t.searchParams.append(`client_id`,this.dynamicConf.google.clientId),t.searchParams.append(`response_type`,`code`),t.searchParams.append(`access_type`,`offline`),t.searchParams.append(`scope`,`profile email`),t.searchParams.append(`redirect_uri`,`${this.dynamicConf.ownerUrl}/profile/registration`);let n=``;e&&(n=`socialProvider=GOOGLE&gender=${e.gender}&mysex=${e.mySex}&searchGenders=${e.searchGenders}`),this.dynamicConf.google.socialProviderState?.length&&(n+=`${n?`&`:``}socialProviderState=${this.dynamicConf.google.socialProviderState}`),n&&t.searchParams.append(`state`,encodeURIComponent(n)),this.googleRegButton.href=t.toString()}initUiTracking(){this.uiTrackingEnabled&&(this.appleRegButton?.addEventListener(`click`,e=>{t.trackUIEvent(`registration-form`,`apple-reg-button`,e.type)},{once:!0}),this.googleRegButton?.addEventListener(`click`,e=>{t.trackUIEvent(`registration-form`,`google-reg-button`,e.type)},{once:!0}))}enableUi(){(this.appleRegButton||this.googleRegButton)&&(this.inputContainer.inert=!1)}},i=class n{constructor(e){this.form=e,this.inputContainer=this.form.querySelector(`.email-password`),this.uiTrackingEnabled=this.form.dataset.biEnabled===`true`,this.errorCountEmail=0,this.errorCountPasswordEmpty=0,this.errorCountPasswordInvalid=0,this.getDomElements(),this.setEventListener(),this.initUiTracking()}initUiTracking(){this.uiTrackingEnabled&&(this.emailInput.addEventListener(`input`,e=>t.trackUIEvent(`registration-form`,`email-input`,e.type),{once:!0}),this.passwordInput.addEventListener(`input`,e=>t.trackUIEvent(`registration-form`,`password-input`,e.type),{once:!0}))}static updateInfoBox(e,t){t.classList.toggle(`is-visible`,e.type===`focus`)}getDomElements(){this.emailInput=this.form.querySelector(`.reg-form-email`),this.passwordInput=this.form.querySelector(`.reg-form-password`),this.passwordRestrictionInfo=this.form.querySelector(`.password-restriction-info`),this.errorMessages={regEmailError:this.form.querySelector(`.email-error`),regPasswordEmptyError:this.form.querySelector(`.password-empty-error`),regPasswordNotValidError:this.form.querySelector(`.password-invalid-error`)},this.passwordRestrictions={minCharacters:this.form.querySelector(`.min-characters`),lettersAndNumbers:this.form.querySelector(`.letters-and-numbers`),partOfEmail:this.form.querySelector(`.part-of-email`)}}
1setEventListener(){this.emailInput.addEventListener(`keyup`,()=>this.onEmailInput()),this.emailInput.addEventListener(`change`,()=>this.onEmailInput()),this.passwordInput.addEventListener(`keyup`,()=>this.onPasswordInput()),this.passwordInput.addEventListener(`change`,()=>this.onPasswordInput()),this.passwordInput.addEventListener(`focus`,e=>{n.updateInfoBox(e,this.passwordRestrictionInfo),n.hideError(this.errorMessages.regPasswordEmptyError),n.hideError(this.errorMessages.regPasswordNotValidError)}),this.passwordInput.addEventListener(`blur`,e=>n.updateInfoBox(e,this.passwordRestrictionInfo))}enableUi(){this.inputContainer.inert=!1}onEmailInput(){e.isValidEmail(this.emailInput.value)&&(n.hideError(this.errorMessages.regEmailError),this.emailInput.classList.remove(`error`),this.emailInput.setAttribute(`aria-invalid`,`false`))}onPasswordInput(){n.hideError(this.errorMessages.regPasswordNotValidError),n.hideError(this.errorMessages.regPasswordEmptyError),this.passwordInput.classList.remove(`error`),this.passwordInput.setAttribute(`aria-invalid`,`false`),e.isValidPasswordLength(this.passwordInput.value)?this.passwordRestrictions.minCharacters.classList.add(`success`):this.passwordRestrictions.minCharacters.classList.remove(`success`),e.hasLettersAndNumbers(this.passwordInput.value)?this.passwordRestrictions.lettersAndNumbers.classList.add(`success`):this.passwordRestrictions.lettersAndNumbers.classList.remove(`success`),e.isNotPartOfEmail(this.emailInput.value,this.passwordInput.value)?this.passwordRestrictions.partOfEmail.classList.add(`success`):this.passwordRestrictions.partOfEmail.classList.remove(`success`)}validate(){this.emailInput.classList.remove(`error`),this.passwordInput.classList.remove(`error`);let r=!0,i=this.passwordInput.value.length===0,a=!e.isValidPasswordLength(this.passwordInput.value),o=!e.hasLettersAndNumbers(this.passwordInput.value),s=!e.isNotPartOfEmail(this.emailInput.value,this.passwordInput.value);return e.isValidEmail(this.emailInput.value)||(r=!1,n.showError(this.errorMessages.regEmailError),this.emailInput.classList.add(`error`),this.emailInput.setAttribute(`aria-invalid`,`true`),this.uiTrackingEnabled&&(t.trackUIEvent(`registration-form`,`form`,`validation-error`,`email`,this.errorCountEmail.toString()),this.errorCountEmail++)),i?(r=!1,n.showError(this.errorMessages.regPasswordEmptyError),this.passwordInput.classList.add(`error`),this.passwordInput.setAttribute(`aria-invalid`,`true`),this.uiTrackingEnabled&&(t.trackUIEvent(`registration-form`,`form`,`validation-error`,`password-empty`,this.errorCountPasswordEmpty.toString()),this.errorCountPasswordEmpty++)):(a||o||s)&&(r=!1,n.showError(this.errorMessages.regPasswordNotValidError),this.passwordInput.classList.add(`error`),this.passwordInput.setAttribute(`aria-invalid`,`true`),this.uiTrackingEnabled&&(t.trackUIEvent(`registration-form`,`form`,`validation-error`,`password-invalid`,this.errorCountPasswordInvalid.toString()),this.errorCountPasswordInvalid++)),r}static showError(e){e.classList.add(`is-visible`),e.textContent=e.dataset.errorText}static hideError(e){e.classList.remove(`is-visible`),e.textContent=``}hideAllErrors(){this.emailInput.classList.remove(`error`),this.passwordInput.classList.remove(`error`),this.passwordRestrictions.minCharacters.classList.remove(`is-visible`),this.passwordRestrictions.lettersAndNumbers.classList.remove(`is-visible`),this.passwordRestrictions.partOfEmail.classList.remove(`is-visible`),this.errorMessages.regEmailError.classList.remove(`is-visible`),this.errorMessages.regPasswordEmptyError.classList.remove(`is-visible`),this.errorMessages.regPasswordNotValidError.classList.remove(`is-visible`)}getInvalidFields(){let e=[];return this.emailInput.classList.contains(`error`)&&e.push(`email`),this.passwordInput.classList.contains(`error`)&&e.push(`password`),e}},a=class{constructor(e,t){let n=document.createElement(`input`);n.type=`hidden`,n.name=`fd`,n.classList.add(`fd`),e.prepend(n);let r=document.createElement(`SCRIPT`);r.src=`/static_app/${t}/_staticversion_/js/iov_combined.js`,document.body.appendChild(r)}},o=class{constructor(e,n,r){this.challengeSucceeded=!1,this.isInteractiveChallenge=!1,this.scriptErrorCallback=()=>{this.challengeSucceeded=!0,document.dispatchEvent(new CustomEvent(`pegLogger-logJsError-WP`,{detail:{message:`Error loading turnstile script`,origin:`Caught_JsError_WP`,stacktrace:`Error loading turnstile script`}}))},this.turnstileBeforeInteractionCallback=()=>{this.isInteractiveChallenge=!0,this.turnstileWrapper.classList.add(`is-interactive-challenge`),this.autoEnableUI&&this.enableUi()},this.turnstileSuccessCallback=()=>{this.challengeSucceeded=!0,this.hideError()},this.turnstileErrorCallback=e=>{t.trackUIEvent(`registration-form`,`turnstile-widget`,`turnstile-error`,e,this.siteKey)},this.showError=()=>{this.errorMessage.classList.add(`is-visible`),this.errorMessage.textContent=this.errorMessage.dataset.errorText},this.hideError=()=>{this.errorMessage.textContent=``,this.errorMessage.classList.remove(`is-visible`)},this.siteKey=n,this.autoEnableUI=r;let i=e.querySelector(`.turnstile-container`);i.classList.add(`is-visible`),this.turnstileWrapper=i.querySelector(`.cf-turnstile`),this.errorMessage=i.querySelector(`.turnstile-error`);let a=()=>turnstile.render(`#${this.turnstileWrapper.id}`,{sitekey:this.siteKey,size:`flexible`,retry:`never`,theme:`light`,appearance:`interaction-only`,callback:this.turnstileSuccessCallback,"error-callback":this.turnstileErrorCallback,"before-interactive-callback":this.turnstileBeforeInteractionCallback,language:document.documentElement.lang.toLowerCase()});if(typeof turnstile>`u`){let e=document.createElement(`script`);
1e.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,e.defer=!0,e.onload=a,e.onerror=this.scriptErrorCallback,document.body.appendChild(e)}else a()}validate(){return!this.challengeSucceeded&&this.isInteractiveChallenge?this.showError():this.hideError(),this.challengeSucceeded}enableUi(){this.isInteractiveChallenge&&(this.turnstileWrapper.removeAttribute(`inert`),this.turnstileWrapper.setAttribute(`aria-hidden`,`false`))}},s=class{static async trackConversion(e){let t=e.querySelector(`.reg-form-email`)?.value||``,n=await this.hashEmail(t);window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:`form_submit_gtm`,hashed_email:n}),typeof gtag==`function`&&typeof window.googleAdsId==`string`&&window.googleAdsId.length!==0&&(gtag(`set`,`user_data`,{email:t}),gtag(`event`,`form_submit`,{send_to:window.googleAdsId}))}static async hashEmail(e){let t=this.normalizeEmail(e),n=new TextEncoder().encode(t),r=await crypto.subtle.digest(`SHA-256`,n);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}static{this.normalizeEmail=e=>{e=e.trim().toLowerCase();let[t,n]=e.split(`@`);return n===`gmail.com`||n===`googlemail.com`?t.replace(/\./g,``)+`@`+n:e}}},c=class{constructor(e,t,n){this.form=e,this.terms=e.querySelector(`.terms`),this.uiTrackingEnabled=e.dataset.biEnabled===`true`,!n&&t?.registration?.legalTextTermsOfService?this.terms.innerHTML=t?.registration.legalTextTermsOfService:t?.registration?.legaltext&&(this.terms.innerHTML=t?.registration.legaltext),this.initUiTracking()}enableUi(){this.terms.inert=!1}initUiTracking(){this.uiTrackingEnabled&&this.form.querySelectorAll(`.terms a`).forEach(e=>{e.addEventListener(`click`,()=>{t.trackUIEvent(`registration-form`,`legal-link`,`click`,e.pathname)},{once:!0})})}},l=class{constructor(e){this.form=e,this.dynamicConf=window.dynamicConf,this.uiTrackingEnabled=this.form.dataset.biEnabled===`true`,this.dynamicConf?.isIovationActive&&new a(e,this.dynamicConf.brandName),this.dynamicConf?.turnstile?.isEnabled&&this.form.dataset.cfTurnstile===`true`&&!window.navigator.userAgent.
1startsWith(`PEG`)&&(this.turnstile=new o(this.form,this.dynamicConf.turnstile.siteKey,this.form.classList.contains(`show-complete-form`))),this.form.addEventListener(`submit`,e=>this.onSubmit(e)),this.emailPassword=new i(this.form),this.form.classList.contains(`no-gender-select`)||(this.genderSelect=new n(e,this.form.classList.contains(`preselect`),this.form.classList.contains(`hetero`),this.form.classList.contains(`search-gender-select`),()=>this.onSexInput())),this.terms=new c(this.form,this.dynamicConf,!!this.genderSelect),this.socialSignOn=new r(this.form,this.genderSelect,this.dynamicConf),(this.form.classList.contains(`show-complete-form`)||this.form.classList.contains(`mobile-show-complete-form`)&&window.innerWidth<768)&&this.showCompleteForm(),this.form.classList.contains(`mobile-hide-complete-form`)&&window.innerWidth>=768&&this.genderSelect?.enableUi(),window.addEventListener(`message`,e=>{e.origin===window.location.origin&&e.data===`reset-modal`&&(this.form.reset(),this.emailPassword.hideAllErrors(),this.genderSelect?.hideError())})}onSexInput(){this.showCompleteForm(),this.genderSelect.isValidSex()&&(this.socialSignOn.setAppleButtonHref(this.genderSelect.getSelectedSex()),this.socialSignOn.setGoogleButtonHref(this.genderSelect.getSelectedSex()))}validateBeforeSubmit(){let e=!0;return this.genderSelect?.validate()===!1&&(e=!1),this.emailPassword.validate()||(e=!1),this.turnstile?.validate()===!1&&(e=!1),e}showCompleteForm(){this.genderSelect?.enableUi(),this.emailPassword.enableUi(),this.turnstile?.enableUi(),this.socialSignOn.enableUi(),this.terms.enableUi(),this.form.classList.add(`show-complete-form`),window.setTimeout(()=>this.form.classList.add(`form-is-complete-visible`),400)}onSubmit(e){if(!this.form.classList.contains(`show-complete-form`)){e.preventDefault(),this.showCompleteForm(),this.uiTrackingEnabled&&t.trackUIEvent(`registration-form`,`form`,`show-complete-form`);return}if(!this.validateBeforeSubmit()){this.trackSubmitEvent(!1),e.preventDefault();return}this.trackSubmitEvent(!0);let n=this.form.querySelector(`button[type="submit"]`);n.disabled=!0,s.trackConversion(this.form)}trackSubmitEvent(e){if(!this.uiTrackingEnabled)return;let n=e?`submit-success`:`submit-failed`,r=this.genderSelect?.getSelectedSex().searchGenders||`none`,i=this.emailPassword.getInvalidFields();t.trackUIEvent(`registration-form`,`form`,n,r,i.join(`_`))}},u=e=>{let t=document.location.origin.replace(`localhost`,`integ-config`),n=document.createElement(`script`);n.src=`${t}/common/dynamicconf`,n.addEventListener(`load`,e),n.addEventListener(`error`,e),document.body.appendChild(n)},d=()=>{document.querySelectorAll(`.psg-reg-form`).forEach(e=>{new l(e)})},f=()=>{window.dynamicConf?d():u(d)};/complete|interactive|loaded/.test(document.readyState)?f():document.addEventListener(`DOMContentLoaded`,()=>f());})();
2//# sourceMappingURL=registration-form.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.