1(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{Qk2r:function(t,r,a){"use strict" 2var o=a("JPst"),c=a.n(o)()((function(t){return t[1]})) 3c.push([t.i,".applePay-root-yVp {\n position: relative;\n}\n.applePay-loadingIndicatorContainer-5OU {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999;\n}\n.applePay-sofortMessage--I- {\n text-align: center;\n margin: 1rem;\n}\n",""]),c.locals={root:"applePay-root-yVp",loadingIndicatorContainer:"applePay-loadingIndicatorContainer-5OU",sofortMessage:"applePay-sofortMessage--I-"},r.a=c},knxC:function(t,r,a){"use strict" 4a.r(r),a.d(r,"default",(function(){return G})) 5var o=a("q1tI"),c=a.n(o),l=(a("ZhjI"),a("LboF")),u=a.n(l),i=a("Qk2r"),d={injectType:"singletonStyleTag",insert:"head",singleton:!0},p=(u()(i.a,d),i.a.locals||{}),y=a("LiED"),v=a("lSNA"),m=a.n(v),b=a("yXPU"),O=a.n(b),g=a("J4zp"),h=a.n(g),j=a("o0o1"),w=a.n(j),P=a("Lm/n"),A=a("pZLH"),C=a("dDsW"),I=a("I3jj"),S=a("FwFz"),k=a("lQ2p"),_=a("664X"),D=a("0sSa"),E=a("rUvP"),M=a("GPmg"),x=a("QMhA"),K=a("DNTo"),R=a("LIdE") 6function ownKeys(t,r){var a=Object.keys(t) 7if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t) 8r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,o)}return a}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{} 9r%2?ownKeys(Object(a),!0).forEach((function(r){m()(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"] 10if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r) 11var a={}.toString.call(t).slice(8,-1) 12return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){a&&(t=a) 13var o=0,c=function F(){} 14return{s:c,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,i=!1 15return{s:function s(){a=a.call(t)},n:function n(){var t=a.next() 16return u=t.done,t},e:function e(t){i=!0,l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(i)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length) 17for(var a=0,o=Array(r);a<r;a++)o[a]=t[a] 18return o}var B=c.a.createElement(K.a,{src:x.a,size:20}),G=function ApplePay(){var t=Object(o.useRef)(null),r=function useApplePay(t){var r,a=t.componentRef,l=Object(o.useRef)(null),u=Object(o.useRef)(null),i=Object(o.useRef)(null),d=Object(o.useRef)(null),p=Object(o.useRef)(null),y=Object(o.useRef)(!1),v=Object(M.a)(),m=h()(v,2)[1],b=m.addToast,g=m.removeToast,j=Object(C.a)().formatMessage,x=j({id:"global.payment.placeOrder.3ds.error",defaultMessage:"Couldn't authorize your payment, please try again."}),K=Object(S.b)(),G=h()(K,2),U=G[0],L=U.cartId,N=U.cartItems,T=G[1].actions,J=T.updateAdyenStateData,Z=T.updateOrderId,H=Object(k.b)(),z=h()(H,2),X=z[0],Y=X.shippingAddress,Q=X.googlePayOrderConfirmationData,W=z[1].actions,V=W.setSofortComponentRef,q=W.setGooglePayOrderConfirmationData,$=W.setCheckoutButtonLoading 19Object(o.useEffect)((function(){i.current=L}),[L]),Object(o.useEffect)((function(){p.current=Q}),[Q]) 20var ee=null==Y||null===(r=Y.country)||void 0===r?void 0:r.code,ne=Object(P.a)(I.b,{variables:{cartId:L,country:ee},fetchPolicy:"network-only"}),te=h()(ne,2),re=te[0],ae=te[1],oe=ae.data,ce=ae.loading 21Object(o.useEffect)((function(){L&&re()}),[L,N,re]) 22var le=Object(o.useMemo)((function(){var t 23return{paymentMethods:null==oe||null===(t=oe.adyenPaymentMethods)||void 0===t||null===(t=t.paymentMethodsResponse)||void 0===t?void 0:t.paymentMethods}}),[oe]),ue=Object(o.useMemo)((function(){var t 24return{extraDetails:null==oe||null===(t=oe.adyenPaymentMethods)||void 0===t?void 0:t.paymentMethodsExtraDetails}}),[oe]),ie=Object(o.useMemo)((function(){if(null!=ue&&ue.extraDetails){var t,r,a=ue.extraDetails.find((function(t){return"applepay"===t.type})) 25return{currency:null==a||null===(t=a.configuration)||void 0===t?void 0:t.currency,value:null==a||null===(r=a.configuration)||void 0===r||null===(r=r.amount)||void 0===r?void 0:r.value}}return{}}),[ue]),se=Object(A.a)(I.g),de=h()(se,1)[0],pe=Object(A.a)(I.a),fe=h()(pe,2),ye=fe[0],ve=fe[1].loading,me=Object(o.useCallback)((function(){(new E.a).removeItem("cartId")}),[]),be=j({id:"page.checkout.payment.applePayUnavailable",defaultMessage:"Apple Pay ran into an error. Please try again or choose another payment method."}),Oe=j({id:"page.checkout.payment.noCardApple",defaultMessage:"No card added to apple wallet"}),ge=Object(o.useRef)("unknown"),he=Object(o.useRef)(null),je=Object(o.useCallback)((function(t){$(!1),he.current=b({type:"error",icon:B,message:"unavailable"===ge.current?Oe:be,timeout:7e3})}),[$,b,be,Oe]),we=Object(o.useRef)(null),Pe=Object(o.useRef)(!1),Ae=Object(o.useRef)(!0),Ce=Object(o.useCallback)((function(){we.current&&(clearTimeout(we.current),we.current=null)}),[]),Ie=Object(o.useCallback)((function(){Ce(),Pe.current=!1,we.current=setTimeout((function(){we.current=null,Pe.current=!0,je(new Error("aucun callback Adyen en ".concat(3e4," ms")))}),3e4)}),[Ce,je]),Se=Object(o.useCallback)((function(){Ce(),Pe.current&&Ae.current&&(Pe.current=!1,null!==he.current&&(g(he.current),he.current=null),$(!0))}),[Ce,g,$]),ke=Object(o.useCallback)((function(){Ce(),Pe.current=!1}),[Ce]) 26Object(o.useEffect)((function(){return function(){Ae.current=!1,Ce()}}),[Ce]) 27var _e=Object(o.useCallback)((function(){Ie() 28try{var t 29null===(t=u.current)||void 0===t||t.submit()}catch(t){Ce(),je(t)}}),[Ie,Ce,je]),De=Object(o.useRef)({submit:null}) 30De.current.submit=_e 31var Ee=function getAdyenPublicToken(){var t 32switch(null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.hostname){case"www.petit-fernand.it":return{locale:"it-IT",environment:"live",clientKey:"live_HBPIDBXU4ZFSJG2KDSGGUYACAIKOOEZB"} 33case"www.esistmeins.de":return{locale:"de-DE",environment:"live",clientKey:"live_HBPIDBXU4ZFSJG2KDSGGUYACAIKOOEZB"} 34case"www.petit-fernand.es":return{locale:"es-ES",environment:"live",clientKey:"live_HBPIDBXU4ZFSJG2KDSGGUYACAIKOOEZB"} 35case"www.petit-fernand.co.uk":case"www.petit-fernand.com":case"www.petit-fernand.ie":return{locale:"en-US",environment:"live",clientKey:"live_HBPIDBXU4ZFSJG2KDSGGUYACAIKOOEZB"} 36case"www.petit-fernand.nl":return{locale:"nl-NL",environment:"live",clientKey:"live_HBPIDBXU4ZFSJG2KDSGGUYACAIKOOEZB"} 37case"www.c-monetiquette.fr":return{locale:"fr-FR",environment:"live",clientKey:"live_HBPIDBXU4ZFSJG2KDSGGUYACAIKOOEZB"} 38default:return{locale:"fr-FR",environment:"test",clientKey:"test_HBGNNA52CFARHNWIIOUGFLE5V4MM5KA3"}}}(),Me=Object(R.a)(),xe=Object(o.useMemo)((function(){return{locale:Ee.locale,countryCode:Me,showPayButton:!1,environment:Ee.environment,clientKey:Ee.clientKey,analytics:{enabled:!0},paymentMethodsResponse:le,onAuthorized:function onAuthorized(t,r){Se(),r.resolve()},onSubmit:(r=O()(w.a.mark((function _callee(t,r,a){var o,l,u,p,v,m,O,g,h,j,P,A,C,I 39return w.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return Se(),y.current=!1,r.prev=1,m=JSON.stringify(t.data),J.receive(m),r.next=2,de({variables:{cartId:i.current,paymentMethod:"adyen_applepay",adyenStateData:m,brandCode:null==t||null===(o=t.data)||void 0===o||null===(o=o.paymentMethod)||void 0===o?void 0:o.type}}) 40case 2:if(O=r.sent,null==(g=O.data.placeOrder)||null===(l=g.errors)||void 0===l||!l.length){r.next=3 41break}h=_createForOfIteratorHelper(g.errors) 42try{for(h.s();!(j=h.n()).done;)P=j.value,b({type:"error",message:c.a.createElement("span",{dangerouslySetInnerHTML:{__html:P.message}})})}catch(t){h.e(t)}finally{h.f()}return y.current=!0,$(!1),a.reject(),r.abrupt("return") 43case 3:if(null!=(A=null==g||null===(u=g.order)||void 0===u?void 0:u.adyen_payment_status)&&A.resultCode){r.next=4 44break}return b({type:"error",message:x}),y.current=!0,$(!1),a.reject(),r.abrupt("return") 45case 4:d.current=null==g||null===(p=g.order)||void 0===p?void 0:p.order_id,Z.receive(null==g||null===(v=g.order)||void 0===v?void 0:v.order_id),C={resultCode:A.resultCode},A.action&&(C.action="string"==typeof A.action?JSON.parse(A.action):A.action),a.resolve(C),r.next=6 46break 47case 5:r.prev=5,I=r.catch(1),b({type:"error",message:I.message}),y.current=!0,$(!1),a.reject()
48case 6:case"end":return r.stop()}}),_callee,null,[[1,5]])}))),function onSubmit(t,a,o){return r.apply(this,arguments)}),onAdditionalDetails:(t=O()(w.a.mark((function _callee2(t,r,a){var o,c,l,u,p,v 49return w.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return Se(),r.prev=1,c=JSON.stringify({details:null==t||null===(o=t.data)||void 0===o?void 0:o.details,orderId:d.current}),r.next=2,ye({variables:{cartId:i.current,payload:c}}) 50case 2:if(l=r.sent,u=l.data,null!=(p=null==u?void 0:u.adyenPaymentDetails)&&p.resultCode){r.next=3 51break}return b({type:"error",message:x}),y.current=!0,$(!1),a.reject(),r.abrupt("return") 52case 3:v={resultCode:p.resultCode},p.action&&(v.action="string"==typeof p.action?JSON.parse(p.action):p.action),a.resolve(v),r.next=5 53break 54case 4:r.prev=4,r.catch(1),b({type:"error",message:x}),y.current=!0,$(!1),a.reject() 55case 5:case"end":return r.stop()}}),_callee2,null,[[1,4]])}))),function onAdditionalDetails(r,a,o){return t.apply(this,arguments)}),onPaymentCompleted:function onPaymentCompleted(){ke(),y.current=!1,q(_objectSpread(_objectSpread({},p.current),{},{orderId:d.current})),me()},onPaymentFailed:function onPaymentFailed(){ke(),$(!1),y.current?y.current=!1:b({type:"error",message:x})},onError:function onError(t){ke(),$(!1),null==t||t.name}} 56var t,r}),[Ee.locale,Ee.environment,Ee.clientKey,Me,le,de,ye,J,Z,q,me,b,$,x,Se,ke]),Ke=Object(o.useMemo)((function(){return{showPayButton:!1,countryCode:Me,amount:ie,totalPriceLabel:"Authorization"}}),[Me,ie]),Re=Object(o.useRef)(xe) 57Re.current=xe 58var Be=Object(o.useRef)(Ke) 59Be.current=Ke 60var Ge=!(null==le||!le.paymentMethods) 61return Object(o.useEffect)((function(){if(Ge){var t=!0 62return function config(){return _config.apply(this,arguments)}(),function(){t=!1 63try{var r,a 64null===(r=u.current)||void 0===r||null===(a=r.unmount)||void 0===a||a.call(r)}catch(t){}}}function _config(){return(_config=O()(w.a.mark((function _callee3(){var r,o,c 65return w.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=1,Object(_.a)(Re.current) 66case 1:if(r=i.sent,o=new D.a(r,Be.current),t){i.next=2 67break}try{null===(c=o.unmount)||void 0===c||c.call(o)}catch(t){}return i.abrupt("return") 68case 2:return l.current=r,u.current=o,i.prev=3,i.next=4,o.isAvailable() 69case 4:t&&a.current&&o.mount(a.current),i.next=6 70break 71case 5:i.prev=5,i.catch(3),$(!1) 72case 6:t&&V(De) 73case 7:case"end":return i.stop()}}),_callee3,null,[[3,5]])})))).apply(this,arguments)}}),[Ge]),Object(o.useEffect)((function(){var t,r=null==le||null===(t=le.paymentMethods)||void 0===t||null===(t=t.find((function(t){return"applepay"===t.type})))||void 0===t||null===(t=t.configuration)||void 0===t?void 0:t.merchantId 74r&&"undefined"!=typeof ApplePaySession&&function(){var t=O()(w.a.mark((function _callee4(){var t,a,o 75return w.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(c.prev=0,"function"!=typeof ApplePaySession.applePayCapabilities){c.next=2 76break}return c.next=1,ApplePaySession.applePayCapabilities(r) 77case 1:return t=c.sent,a=t.paymentCredentialStatus,ge.current="paymentCredentialsUnavailable"===a?"unavailable":"paymentCredentialsAvailable"===a?"available":"unknown",c.abrupt("return") 78case 2:if("function"!=typeof ApplePaySession.canMakePaymentsWithActiveCard){c.next=4 79break}return c.next=3,ApplePaySession.canMakePaymentsWithActiveCard(r) 80case 3:o=c.sent,ge.current=o?"available":"unavailable" 81case 4:c.next=6 82break 83case 5:c.prev=5,c.catch(0),ge.current="unknown" 84case 6:case"end":return c.stop()}}),_callee4,null,[[0,5]])}))) 85return function detectActiveCard(){return t.apply(this,arguments)}}()()}),[le]),{loading:ce,adyenPaymentDetailsLoading:ve}}({componentRef:t}),a=r.loading,l=r.adyenPaymentDetailsLoading 86return c.a.createElement("div",{className:p.root},l&&c.a.createElement("div",{className:p.loadingIndicatorContainer},c.a.createElement(y.a,{parentName:"ApplePay"})),a?c.a.createElement("div",null,c.a.createElement(y.a,{parentName:"ApplePay"})):c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{ref:t})))}}}])
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.