1(self["FC.EcomwebpackJsonp"]=self["FC.EcomwebpackJsonp"]||[]).push([[3791,2341,350],{10079:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var r=n(2358),o=n(47012),a=n(98530),i=n(41280),s=n(40939),c=function(){return c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},c.apply(this,arguments)},u=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}c((r=r.apply(t,e||[])).next())}))},l=function(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},d=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p=function(){function t(t){var e,n=this;this.container=t,this.adobeCommerceConnectionData=(0,o.getData)(document.querySelector("html"),"data-adobe-commerce-connection"),this.commonTexts=(0,o.getData)(document.querySelector(".rc-cart-summary-box"),"data-common-texts"),this.countryCode=document.querySelector("html").getAttribute("lang").split("-")[1].toUpperCase();var r=null===(e=i.store.getState())||void 0===e?void 0:e.cart;(null==r?void 0:r.id)?(this.cart=r,this.initializePaymentMethods()):i.store.subscribe((function(){var t,e=null===(t=i.store.getState())||void 0===t?void 0:t.cart;(null==e?void 0:e.id)&&(n.cart=e,n.initializePaymentMethods())}))}return t.setup=function(e){void 0===e&&(e=".payment-method-selection"),Array.from(document.querySelectorAll(e)).filter((function(t){return!t.dataset.moduleInitialized})).forEach((function(e){new t(e),e.dataset.moduleInitialized="true"}))},t.prototype.initializePaymentMethods=function(){return u(this,void 0,void 0,(function(){var t;return l(this,(function(e){switch(e.label){case 0:return[4,this.getPaymentMethods()];case 1:return(t=e.sent()).Adyen.payload&&this.initializeAdyenComponents(JSON.parse(t.Adyen.payload)),[2]}}))}))},t.prototype.initializeAdyenComponents=function(t){return u(this,void 0,void 0,(function(){var e,n,o,a,i,s,p=this;return l(this,(function(h){return a=t.paymentMethodsResponse.paymentMethods.filter((function(t){return"applepay"===t.type})).length>0,i=t.paymentMethodsResponse.paymentMethods.filter((function(t){return"googlepay"===t.type})).length>0,s={locale:document.getElementsByTagName("html")[0].getAttribute("lang"),environment:this.container.getAttribute("data-environment"),clientKey:this.container.getAttribute("data-adyen-components-client-key"),showPayButton:!0,paymentMethodsResponse:t.paymentMethodsResponse,paymentMethodsConfiguration:c(c({},a&&t.paymentMethodsExtraDetails.applepay.configuration&&{applepay:c(c({icon:t.paymentMethodsExtraDetails.applepay.icon},t.paymentMethodsExtraDetails.applepay.configuration),{countryCode:this.countryCode,buttonType:"buy",buttonColor:"black",showPayButton:!0,requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["postalAddress","name","phone","email"],onAuthorized:function(t,r,a){return u(p,void 0,void 0,(function(){var r,i,s;return l(this,(function(c){switch(c.label){case 0:return console.log(a.payment.billingContact),console.log(a.payment.shippingContact),r=a.payment.shippingContact,i={email:r.emailAddress,salutation:"",firstname:r.givenName,lastname:r.familyName,company:"",countryCode:r.countryCode,postcode:r.postalCode,city:r.locality,addressLines:r.addressLines,telephone:r.phoneNumber},[4,this.placeOrderExpress(i,n)];case 1:return s=c.sent(),[4,this.handlePlaceOrderResponse(s,o)];case 2:return e=c.sent(),t(),[2]}}))}))}})}),i&&t.paymentMethodsExtraDetails.googlepay.configuration&&{googlepay:c(c({},t.paymentMethodsExtraDetails.googlepay.configuration),{transactionInfo:this.getTransactionInfo(),callbackIntents:["SHIPPING_ADDRESS"],shippingAddressRequired:!0,emailRequired:!0,shippingOptionRequired:!1,paymentDataCallbacks:{onPaymentDataChanged:function(t){var e=this;return new Promise((function(n){return u(e,void 0,void 0,(function(){var e,r,o,a;return l(this,(function(i){return e=t.callbackTrigger,r=t.shippingAddress,o=t.shippingOptionData,a={},console.log(e),console.log(r),console.log(o),n(a),[2]}))}
1))}))}},onAuthorized:function(t){return u(p,void 0,void 0,(function(){var r,a,i,s;return l(this,(function(c){switch(c.label){case 0:return console.log("Shopper details",t),r=t.shippingAddress.name.split(" "),a=r.pop(),r||(console.info("The name must consist of at least two words, we set first name to last name"),r=[a]),i={email:t.email,salutation:"",firstname:r.join(),lastname:a,company:"",countryCode:t.shippingAddress.countryCode,postcode:t.shippingAddress.postalCode,city:t.shippingAddress.locality,addressLines:[t.shippingAddress.address1,t.shippingAddress.address2,t.shippingAddress.address3],telephone:t.shippingAddress.phoneNumber},[4,this.placeOrderExpress(i,n)];case 1:return s=c.sent(),[4,this.handlePlaceOrderResponse(s,o)];case 2:return e=c.sent(),[2]}}))}))}})}),beforeSubmit:function(t,e,n){n.resolve(t)},onSubmit:function(t,e){n=t,o=e},onError:function(t,n){return u(p,void 0,void 0,(function(){return l(this,(function(r){switch(r.label){case 0:return[4,this.handleErrors("error in initializeAdyenComponents (onError), component: ".concat(n.displayName,", guid: ").concat(e),t)];case 1:return r.sent(),[2]}}))}))},onAdditionalDetails:function(t,n){return u(p,void 0,void 0,(function(){var r,o;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,5]),[4,this.getPaymentDetails({guid:e,payload:JSON.stringify(t.data),cartId:this.cart.id})];case 1:return r=a.sent(),[4,this.handlePlaceOrderResponse(r,n)];case 2:case 4:return a.sent(),[3,5];case 3:return o=a.sent(),[4,this.handleErrors("error in initializeAdyenComponents (onAdditionalDetails), component: ".concat(n._id,", guid: ").concat(e,", state: ").concat(t.data),o)];case 5:return[2]}}
1))}))}},(0,r.Z)(s).then((function(t){var e,n,r=p.container.querySelector("ul");r.classList.add("express-payment-list"),"true"===p.container.getAttribute("data-express-only")&&(t.paymentMethodsResponse.paymentMethods=t.paymentMethodsResponse.paymentMethods.filter((function(t){return"applepay"===t.type||"googlepay"===t.type}))),r.innerHTML="";try{for(var o=d(t.paymentMethodsResponse.paymentMethods),a=o.next();!a.done;a=o.next()){var i=a.value;if("applepay"!==i.type||window.ApplePaySession&&ApplePaySession.canMakePayments()){var s="".concat(i.type,"-express-container"),c=p.createExpressPaymentMethodHtmlElement(s);r.append(c),t.create(i.type).mount("#"+s)}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}})),[2]}))}))},t.prototype.placeOrderExpress=function(t,e){return u(this,void 0,void 0,(function(){var n,r,o;return l(this,(function(a){switch(a.label){case 0:return[4,this.getMagentoShippingMethods(t)];case 1:return n=a.sent(),[4,this.saveInfoForExpressPayment({shippingAddress:t,shippingMethodCode:n.methods[0].methodCode,shippingCarrierCode:n.methods[0].carrierCode})];case 2:if(a.sent(),!e.isValid)return[3,7];a.label=3;case 3:return a.trys.push([3,5,,7]),[4,this.placeOrder({paymentProvider:"adyen",cartId:this.cart.id,additionalData:{stateData:JSON.stringify(e.data),brand:"",type:e.data.paymentMethod.type}})];case 4:return r=a.sent(),console.log(r),[2,r];case 5:return o=a.sent(),[4,this.handleErrors("error in placeOrderExpress",o)];case 6:return a.sent(),[3,7];case 7:return[2]}}
1))}))},t.prototype.createExpressPaymentMethodHtmlElement=function(t){var e=document.createElement("li");return e.innerHTML='<div class="express-payment-container" id="'.concat(t,'"></div>'),e},t.prototype.getPaymentMethods=function(){return u(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,a.default.client.get("".concat(a.default.getCartEndpoint(this.cart.id),"/payment-methods"))];case 1:return[2,t.sent().data]}}))}))},t.prototype.getMagentoShippingMethods=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,a.default.client.post("".concat(a.default.getCartEndpoint(this.cart.id),"/shipping-methods"),t)];case 1:return[2,e.sent().data]}}))}))},t.prototype.saveInfoForExpressPayment=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,a.default.client.post("".concat(a.default.getCartEndpoint(this.cart.id),"/express/customer-information"),t)];case 1:return[2,e.sent().data]}}))}))},t.prototype.placeOrder=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,a.default.client.post("".concat(a.default.getOrdersEndpoint()),t)];case 1:return[2,e.sent().data]}}))}))},t.prototype.logErrors=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,a.default.client.post("".concat(a.default.getLoggingEndpoint()),t)];case 1:return e.sent(),[2]}}))}))},t.prototype.getPaymentDetails=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,a.default.client.post("".concat(a.default.getOrdersEndpoint(),"/payment-details"),t)];case 1:return[2,e.sent().data]}}))}))},t.prototype.handlePlaceOrderResponse=function(t,e){return u(this,void 0,void 0,(function(){return l(this,(function(n){switch(n.label){case 0:return t.orderId&&t.isFinal&&(0,s.kT)(o.cartCookieName),t.action?(e.handleAction(t.action),[2,t.orderId]):[3,1];case 1:switch(t.resultCode){case"Authorised":return[3,2];case"Pending":case"Received":return[3,3]}return[3,4];case 2:return window.location.href="/_checkout/redirect/shop/order-confirmation?guid="+t.orderId,[3,6];case 3:return window.location.href="/_checkout/redirect/shop/order-confirmation?pending=true&guid="+t.orderId,[3,6];case 4:return[4,this.handleErrors("error in handlePlaceOrderResponse, orderId is unknown, result code: "+t.resultCode,null)];case 5:return n.sent(),[3,6];case 6:return[2]}}
1))}))},t.prototype.handleErrors=function(t,e,n){return void 0===n&&(n=!0),u(this,void 0,void 0,(function(){var r;return l(this,(function(o){switch(o.label){case 0:return r={error:"".concat((new Date).toLocaleString("de-DE"),": ").concat(t," | name: ").concat(null==e?void 0:e.name,", message: ").concat(null==e?void 0:e.message," stack: ").concat(null==e?void 0:e.stack," | ").concat(this.getErrorAnalysisInfo())},[4,this.logErrors(r)];case 1:return o.sent(),n&&(window.location.href="/_checkout/redirect/shop/payment-error"),[2]}}))}))},t.prototype.getErrorAnalysisInfo=function(){return["User Agent: ".concat(navigator.userAgent," "),"Platform: ".concat(navigator.platform," "),"Language: ".concat(navigator.language," "),"Cookies Enabled: ".concat(navigator.cookieEnabled," "),"Do Not Track: ".concat(navigator.doNotTrack," ")].join("\n")},t.prototype.getShippingMethods=function(t){return Promise.resolve([{label:"Standard Shipping",detail:"",amount:this.cart.cartSummary.deliveryCost.value.toString(),identifier:"Standard"}])},t.prototype.createLineItems=function(t){var e=this.cart.items.map((function(t){return{label:t.sitecoreProductInfo.Name,amount:(t.price.value*t.quantity).toString(),type:"final"}}));return e.push({label:"Delivery: ".concat(t.label),amount:t.amount,type:"final"}),e},t.prototype.createApplePayTotal=function(t){var e=0;return t.forEach((function(t){return e+=parseFloat(t.amount)})),{label:"FABER CASTELL",amount:e.toString()}},t.prototype.createApplePayAmountHelper=function(){var t=null;return{getFinalAdyenAmount:function(){return(e=t.amount).includes(".")?Number(e.replace(".","")):Number("".concat(e,"00"));var e},getApplePayTotal:function(){return t},setApplePayTotal:function(e){t=e}}},t.prototype.getTransactionInfo=function(){var t,e,n;return{displayItems:[{label:null===(t=this.commonTexts)||void 0===t?void 0:t.subTotal,type:"SUBTOTAL",price:this.cart.cartSummary.subTotal.value.toString()},{label:null===(e=this.commonTexts)||void 0===e?void 0:e.additionalTotalInfo,type:"TAX",price:this.cart.cartSummary.totalTax.value.toString()}],countryCode:this.countryCode,currencyCode:this.cart.cartSummary.grandTotal.currencyIsoCode,totalPriceStatus:"FINAL",totalPrice:this.cart.cartSummary.grandTotal.value.toString(),totalPriceLabel:null===(n=this.commonTexts)||void 0===n?void 0:n.total}},t}();const h=p;p.setup()},41280:(t,e,n)=>{"use strict";n.r(e),n.d(e,{store:()=>c});var r=n(24886),o=n(95967),a=n(93628),i=n(51346),s=n(81248),c=(0,r.xC)({reducer:{cart:o.default,coupons:a.default,variantEditor:i.default},middleware:function(t){return t().concat((0,s.K3)())}});(0,s.UX)(c)},51346:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h,getEditVariantStateAsync:()=>d,getVariantEditor:()=>u,setEditVariantStateAsync:()=>p,setVariantEditor:()=>l});var r,o=n(24886),a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},i=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}c((r=r.apply(t,e||[])).next())}))},s=function(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},c=(0,o.oM)({name:"variantEditor",initialState:{itemId:"",sku:""},reducers:{getVariantEditor:function(t){return t},setVariantEditor:function(t,e){return a({},e.payload)}}}),u=(r=c.actions).getVariantEditor,l=r.setVariantEditor,d=function(){return function(t){return i(void 0,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t(u())];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),console.error("Error getting state of variant editor:",e),[3,3];case 3:return[2]}}
1))}))}},p=function(t,e){return function(n){return i(void 0,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,n(l({itemId:t,sku:e}))];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),console.error("Error setting state of variant editor:",r),[3,3];case 3:return[2]}}))}))}};const h=c.reducer},44595:()=>{},65050:()=>{}}]);
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.