1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3598],{5498:(e,r,a)=>{"use strict";a.d(r,{_E:()=>p,wY:()=>f});var t=a(37876),o=a(62506),n=a(29171),i=a(13664),s=a(27058),l=a(70111),u=a(61154),d=a(11557),c=a(14232);let p="__xpay-data__",f=e=>{let{components:r}=(0,i.j)(),{locale:a}=(0,n.U)(),f=(0,s.k)().query,{isPaymentMethodEnabled:m}=(0,l.l)({params:f,avoidConfigChecks:!0,paymentMethod:u.g5.XPay,previousPage:e.previousPage,hideTimeout:!0});return(0,c.useEffect)(()=>{if(!m)return;let r={previousPage:e.previousPage,saleAk:f.saleAk,redirectToURL:f.redirectToURL,paymentRef:f.paymentRef,fallbackUrl:f.fallbackURL||e.previousPage};sessionStorage.setItem(p,JSON.stringify(r));let[t,o]=d.o9.tenantAndSite,n="/payments/api/".concat(t,"/").concat(o,"/v1/xpay/entrypoint"),i=new URL(d.o9.beBaseUrl+n);i.searchParams.append("paymentRef",f.paymentRef),i.searchParams.append("locale",a),i.searchParams.append("portal",d.o9.portal),window.location.replace(i)},[m]),(0,t.jsx)(o.U,{show:!0,loader:(0,t.jsx)(r.Loader,{show:!0})})}},67667:(e,r,a)=>{"use strict";a.r(r),a.d(r,{default:()=>f});var t=a(37876),o=a(62506),n=a(13664),i=a(27058),s=a(70111),l=a(13057),u=a(61154),d=a(14232),c=a(5498),p=function(e){return e.OK="OK",e.KO="KO",e.CANCELED="ANNULLO",e.ERROR="ERRORE",e}(p||{});let f=()=>{let{components:e}=(0,n.j)(),r=(0,i.k)(),a=(0,d.useMemo)(()=>{let e=sessionStorage.getItem(c._E);return e?JSON.parse(e):null},[]),p=r.query,{isPaymentMethodEnabled:f}=(0,s.l)({avoidConfigChecks:!0,avoidParamChecks:!0,paymentMethod:u.g5.XPay,previousPage:null==a?void 0:a.previousPage,hideTimeout:!0,doAdditionalChecks:()=>void 0!=p&&p.esito?(null==a?void 0:a.paymentRef)&&(null==a?void 0:a.fallbackUrl)&&(null==a?void 0:a.redirectToURL)?void 0:(console.error("XPAY - Missing stored info"),!0):(console.error("XPAY - Missing required info: parameters"),!0)});return(0,d.useEffect)(()=>{if(!f)return;if("OK"!==p.esito)return void r.goToPaymentErrorPage({paymentRef:a.paymentRef,fallbackUrl:a.fallbackUrl,outcome:"ANNULLO"===p.esito?l.t.Cancelled:l.t.Failed});let e=a.redirectToURL;sessionStorage.removeItem(c._E),r.goToPage(e,{query:{paymentRef:a.paymentRef},asUrlWithoutParams:!0,replace:!0})},[f]),(0,t.jsx)(o.U,{show:!0,loader:(0,t.jsx)(e.Loader,{show:!0})})}},70111:(e,r,a)=>{"use strict";a.d(r,{l:()=>h});var t=a(32516),o=a(59096),n=a(33392),i=a(14232),s=a(42135),l=a(29171),u=a(13664),d=a(92345),c=a(61154),p=a(79444),f=a(95597),m=a(27058);let h=e=>{let{paymentMethod:r,params:a,previousPage:h,avoidConfigChecks:y,avoidParamChecks:v,configs:g,doAdditionalChecks:P,hideTimeout:R}=e,{behaviour:U}=(0,u.j)(),{loggedUser:k}=(0,l.U)(),{goHome:_}=(0,m.k)(),{setCustomPage:w,getMetaPaymentPageByUrl:E}=(0,d.t)(),{clear:L}=(0,o.F)(),C=(0,i.useMemo)(()=>"".concat(r," PAYMENT - "),[r]),{value:T,setTrue:N}=(0,s.Cg)(!1);return(0,n.S)(()=>{if(!y&&!g||(0,f.fU)({behaviour:U,loggedUser:k,paymentMethod:r})){console.error(C+"Missing required configs"),_({replace:!0});return}if(!v&&(!a||!(0,f.oc)(a,h))){console.error(C+"Missing required info"),_({replace:!0});return}if(null==P?void 0:P())return void _({replace:!0});let e=h?new URL(h).pathname:"/",t=E(e);t&&(e=t),(0,p.yy)(500).then(()=>{w(e,{hideCart:!0,hideTimeout:R||!1}),N()})}),{isPaymentMethodEnabled:T,handleBrowserBack:(0,i.useCallback)((e,r,a)=>{U.checkout.paymentErrorHandlingMode===c.PI.ClearCartAndGoToFirstPage&&L(),t.w.abortOrder(e,r,a).catch(p.Zi)},[U,L])}}},73124:(e,r,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/payments/xpay/result",function(){return a(67667)}])},95597:(e,r,a)=>{"use strict";function t(e){var r,a;let{behaviour:t,loggedUser:o,paymentMethod:n}=e,i=null==(a=null==o||null==(r=o.loadCreditPaymentMethods)?void 0:r.includes(n))||a;return!t||!t.paymentMethodsList.includes(n)&&!i}function o(e,r){return r&&(null==e?void 0:e.paymentRef)&&(null==e?void 0:e.saleAk)&&(null==e?void 0:e.redirectToURL)}function n(e){let r=e instanceof URL?e:new URL(e);return{pathName:r.pathname,query:Array.from(r.searchParams.entries()).reduce((e,r)=>({...e,[r[0]]:r[1]}),{})}}a.d(r,{bG:()=>n,fU:()=>t,oc:()=>o})}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=73124)),_N_E=e.O()}]);
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.