PageSourceSearch

https://justnails-shop.de/theme/c91431acdc3d921c2f09e846dc1e2728/j…ock-notification.stock-alert-form.a01cc3.js

js justnails-shop.de collected 2026-10-02 17:54:35 UTC 11,153 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[99963],{68(t,e,s){s.d(e,{A:()=>i});class i{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",t,s);return this._sendRequest(i,null,e)}post(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let n=this._createPreparedRequest("POST",t,i);return this._sendRequest(n,e,s)}delete(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let n=this._createPreparedRequest("DELETE",t,i);return this._sendRequest(n,e,s)}patch(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let n=this._createPreparedRequest("PATCH",t,i);return this._sendRequest(n,e,s)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn(`the request to ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${t.responseURL} timed out`)})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,s){return this._registerOnLoaded(t,s),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,s){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}}},156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==s},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function n(t,e,s){return t.concat(e).map(function(t){return i(t,s)})}function r(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function o(t,e){try{return e in t}catch(t){return!1}}function a(t,s,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=i;var c,h,u=Array.isArray(s);return u!==Array.isArray(t)?i(s,l):u?l.arrayMerge(t,s,l):(h={},(c=l).isMergeableObject(t)&&r(t).forEach(function(e){h[e]=i(t[e],c)}),r(s).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&c.isMergeableObject(s[e])?h[e]=(function(t,e){if(!e.customMerge)return a;var s=e.customMerge(t);return"function"==typeof s?s:a})(e,c)(t[e],s[e],c):h[e]=i(s[e],c))}),h)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,s){return a(t,s,e)},{})},t.exports=a},373(t,e,s){s.d(e,{A:()=>a});var i=s(156),n=s.n(i);class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let s=r.toUpperCamelCase(t,e);return r.lcFirst(s)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(t,{detail:e,cancelable:s});return this.el.dispatchEvent(i),i}subscribe(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,n=t.split("."),r=s.scope?e.bind(s.scope):e;if(s.once&&!0===s.once){let e=r;r=function(s){i.unsubscribe(t),e(s)}}return this.el.addEventListener(n[0],r),this.listeners.push({splitEventName:n,opts:s,cb:r}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,s)=>([...s.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):t.push(s),t),[]),!0}
1reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class a{constructor(t,e={},s=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${s}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(s),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),n().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${e}-config`);return s?window.PluginConfigManager.get(this._pluginName,s):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${e}-options`);if(s)try{return JSON.parse(s)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}},963(t,e,s){s.r(e),s.d(e,{default:()=>r});var i=s(68),n=s(373);class r extends n.A{static #t=this.options={stockAlertBellMessage:"",stockHideAlertBellMessage:"",confirmed:!1,hiddenSubmitSelector:".submit--hidden",stockAlertSubmitSelector:".acris-low-stock-alert-button",hiddenStockAlertFormSelector:".acris-stock-alert-form-display-form",hiddenStockAlertArrowSelector:".acris-stock-alert-button-collapse-icon",overlayBlock:".acris-stock-alert-alert-overlay",messageNotify:".acris-stock-alert-notify",messageExist:".acris-stock-alert-exists",stockNotificationForm:".acris-stock-alert-form-input-group",privacyNotificationWrapper:".stock-alert-privacy-notice",activeClass:"is-active",contentType:"application/x-www-form-urlencoded",overlayTime:4e3};init(){this._client=new i.A(window.accessKey,window.contextToken),this._getButton(),this._getAlertStockForm(),this._getHiddenSubmit(),this._getMessages(),this._getOverlayBlock(),this._registerEvents()}_registerEvents(){if(this.el.addEventListener("submit",this._handleSubmit.bind(this)),this._button&&(this._button.addEventListener("submit",this._handleSubmit.bind(this)),this._button.addEventListener("click",this._handleSubmit.bind(this))),this._iconButtons&&this._hiddenForm)for(let t=0;t<this._iconButtons.length;t++)this._iconButtons[t].addEventListener("click",this._handleStockAlertSubmit.bind(this,this._iconButtons[t])),this.options.confirmed&&this._iconButtons[t].click()}_getButton(){this._button=this.el.querySelector("button")}_getAlertStockForm(){this._iconButtons=document.querySelectorAll([this.options.stockAlertSubmitSelector]),this._hiddenForm=document.querySelectorAll([this.options.hiddenStockAlertFormSelector])}_getMessages(){this._messageNotify=this.el.querySelector(this.options.messageNotify),this._messageExist=this.el.querySelector(this.options.messageExist),this._form=this.el.querySelector(this.options.stockNotificationForm),this._privacyNotice=this.el.querySelector(this.options.privacyNotificationWrapper)}_getHiddenSubmit(){this._hiddenSubmit=this.el.querySelector(this.options.hiddenSubmitSelector)}_getOverlayBlock(){this._block=this.el.querySelector(this.options.overlayBlock)}_handleSubmit(t){t.preventDefault(),this.el.checkValidity()?this._submitForm(
1):this._showValidation()}_handleStockAlertSubmit(t,e){e.preventDefault();for(let e=0;e<this._hiddenForm.length;e++){let s=this._hiddenForm[e];if(s&&(s.classList.contains("d-none")?s.classList.remove("d-none"):s.classList.add("d-none"),t)){let e=t.querySelector(this.options.hiddenStockAlertArrowSelector);e&&(e.classList.contains("d-none")?e.classList.remove("d-none"):e.classList.add("d-none")),t.title===this.options.stockAlertBellMessage?t.title=this.options.stockHideAlertBellMessage:t.title=this.options.stockAlertBellMessage,t.ariaLabel===this.options.stockAlertBellMessage?t.ariaLabel=this.options.stockHideAlertBellMessage:t.ariaLabel=this.options.stockAlertBellMessage}}}_showValidation(){this._hiddenSubmit.click()}_submitForm(){this.formSubmittedByCaptcha||(this.$emitter.publish("beforeSubmit"),this.sendAjaxFormSubmit())}sendAjaxFormSubmit(){let t=new FormData(this.el);fetch(this.el.action,{method:"POST",body:t,headers:{"X-Requested-With":"XMLHttpRequest"}}).then(t=>t.text()).then(t=>this._handleResponse(t))}_handleResponse(t){let e=null;try{e=JSON.parse(t)}catch(t){}if(this.$emitter.publish("onFormResponse",t),this.el.dispatchEvent(new CustomEvent("removeLoader")),!e||!(e.length>0))return!1;{let t=!0,s=!1,i="";for(let n=0;n<e.length;n++)"danger"===e[n].type&&(t=!1),"emailExist"===e[n].message&&(s=!0),i+=e[n].alert;this._createResponse(t,i,s)}}_toggleMessage(t){t?(this._messageNotify.classList.contains("d-none")||this._messageNotify.classList.add("d-none"),this._messageExist.classList.contains("d-none")&&this._messageExist.classList.remove("d-none")):(this._messageExist.classList.contains("d-none")||this._messageExist.classList.add("d-none"),this._messageNotify.classList.contains("d-none")||this._messageNotify.classList.add("d-none"))}_createResponse(t,e,s){let i=this.options,n=this._block;
1if(s)this._toggleMessage(!0);else if(this._toggleMessage(!1),n.classList.add(i.activeClass),t){this._form.classList.contains("d-none")||this._form.classList.add("d-none"),this._privacyNotice&&!this._privacyNotice.classList.contains("d-none")&&this._privacyNotice.classList.add("d-none"),n.textContent="";let t=document.createElement("div");t.classList.add("overlay-inner"),t.innerHTML=e,n.appendChild(t)}else{n.textContent="";let t=document.createElement("div");t.classList.add("overlay-inner"),t.innerHTML=e,n.appendChild(t),setTimeout(function(){n.classList.remove(i.activeClass)},i.overlayTime)}}}}}]);

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.