1/*! For license information please see app-modules-cart-views-InvoiceAddressAndPayment-e894b30abdf9d43a7de6.min.js.LICENSE.txt */ 2"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[4163],{40567(e,t,s){s.d(t,{A:()=>o});var a=s(70227),i=s(51998),r=s(11124);function o(e){let t=e.isHidden,s=e.progress,o=e.children;return r.KJ?i.createPortal(a.createElement("div",{className:"fixed bottom-0 left-0 right-0 top-0 z-[999] flex flex-col items-center justify-center gap-4 bg-white bg-opacity-40 backdrop-blur-[2px]",hidden:t},a.createElement("div",{className:"relative"},a.createElement("svg",{className:"h-[180px] w-[180px] animate-spin",viewBox:"0 0 100 100"},a.createElement("circle",{fill:"none",strokeWidth:"1",className:"stroke-chroma-black-20",cx:"50",cy:"50",r:"40"}),a.createElement("circle",{fill:"none",strokeWidth:"1",className:"stroke-chroma-black",strokeDasharray:"250",strokeDashoffset:"210",cx:"50",cy:"50",r:"40"})),s),o),document.getElementById("root")):null}},14063(e,t,s){s.d(t,{A:()=>b});var a=s(70227),i=s(75931),r=s(81717),o=s.n(r),n=s(54262),d=s(97121);var c,l,m=s(38330),p=s(18113),h=s(72639),u=s(16333),f=s(94219);function v(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function y(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?v(Object(s),!0).forEach(function(t){g(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):v(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function g(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}let b=(0,i.Ng)(e=>{var t;return{currency:e.cart.cartContent.currency,paymentType:(null===(t=e.cart.cartContent.paymentInformation)||void 0===t?void 0:t.type)||null}})((l=class extends a.Component{constructor(e){super(e),g(this,"methodsForm",{}),this.state={selectedOrganizationType:null,selectedProofOfPurchaseType:null}}componentDidMount(){this.props.paymentType===f.d.Spingo&&this.setState({selectedOrganizationType:m.C.company,selectedProofOfPurchaseType:p.d.invoice})}componentWillReceiveProps(e){e.paymentType===f.d.Spingo&&this.setState({selectedOrganizationType:m.C.company,selectedProofOfPurchaseType:p.d.invoice}),e.invoiceInformation&&Object.keys(e.invoiceInformation).length}getFormDefaultValues(e){const t=y({},e.invoiceInformation)||{};return t.organizationType||(t.organizationType=m.C.company),t}getOrganizationType(e){let t=e.invoiceInformation;const s=this.getFormDefaultValues({invoiceInformation:t});return this.state.selectedOrganizationType||s.organizationType}getFormConfig(e){let t=e.organizationType,s=e.allowAddressSaving,i=e.onAddressSave,r=e.invoiceInformation,o=(e.editMode,e.isRebranding,(0,d.A)(t,{excludeFields:["phoneNumber"],addressLineLengthValidator:(e,t)=>{const s=this.methodsForm.getRawData(),a=s.addressLine1,i=s.addressLine2;return!((null==a?void 0:a.length)+(null==i?void 0:i.length)>60)&&!((null==a?void 0:a.length)>60)}}));return s&&o.push(...function(e){let t=e.onSave;return[{type:"separator"},{type:"text",name:"entryName",label:a.createElement(n.sA,{id:"Forms.addressName"}),className:"w-full",isConditionallyRequired:e=>"saveAddress"===e,validator:(e,t)=>"saveAddress"!==t||e&&e.length,errorMessage:a.createElement(n.sA,{id:"Forms.addressNameError"})},{type:"action",name:"saveAddress",label:a.createElement(n.sA,{id:"Forms.saveInvoiceAddress"}),className:"w-full !mt-2",isFullWidth:!0,onClick:t}]}({onSave:e=>i(y(y({},e),{},{organizationType:this.getOrganizationType({invoiceInformation:r})}))})),o}render(){const e=this.props;this.state;return a.createElement("div",null,e.paymentType!==f.d.Spingo&&!e.isHidden&&a.createElement(u.A,{options:[{label:a.createElement(n.sA,{id:"Organization.type.personal"}),value:m.C.personal},{label:a.createElement(n.sA,{id:"Organization.type.company"}),value:m.C.company}],selectedValue:this.getOrganizationType({invoiceInformation:e.invoiceInformation}),onChange:e=>{this.setState({selectedOrganizationType:e})},isRebranding:e.isRebranding,className:"w-fit",size:"s"}),a.createElement(h.A,{className:"flex flex-row flex-wrap space-y-0 gap-y-6 mt-6 lg:mt-8",config:this.getFormConfig({organizationType:this.getOrganizationType({invoiceInformation:e.invoiceInformation}),invoiceInformation:e.invoiceInformation,allowAddressSaving:e.allowAddressSaving,onAddressSave:e.onAddressSave,editMode:e.editMode,isRebranding:e.isRebranding}),defaultValues:this.getFormDefaultValues({invoiceInformation:e.invoiceInformation}),onSubmit:t=>e.onSubmit(y(y({},t),{},{organizationType:this.getOrganizationType({invoiceInformation:e.invoiceInformation}),proofOfPurchase:p.d.invoice})),formId:"invoiceAndPayment",getExposedMethods:t=>{this.methodsForm=t,e.getExposedMethods(y(y({},t),{},{setValues:e=>{this.setState({selectedOrganizationType:e.organizationType},()=>t.setValues(e))}}))},isRebranding:e.isRebranding,isHidden:e.isHidden,doNotScrollToErrors:!0,validationInfoMessage:"nw_addressValidationInfo"}))}},g(l,"propTypes",{onSubmit:o().func,getExposedMethods:o().func,invoiceInformation:o().object,allowAddressSaving:o().bool,onAddressSave:o().func,editMode:o().bool,isRebranding:o().bool,isHidden:o().bool}),g(l,"defaultProps",{editMode:!1,isRebranding:!1,isHidden:!1}),c=l))||c},18113(e,t,s){s.d(t,["d",0,{invoice:"invoice",receipt:"receipt"}])},83828(e,t,s){s.d(t,{A:()=>p});var a,i,r,o=s(70227),n=s(81717),d=s.n(n),c=s(54262),l=s(18980),m=s(19597);class p extends o.Component{render(){const e=this.props;return o.createElement(l.A,{modalId:"forbiddenNIPModal",isVisible:e.isVisible,title:o.createElement(c.sA,{id:"ForbiddenModal.title"}),message:o.createElement("div",null,o.createElement(c.sA,{tagName:"p",id:"ForbiddenModal.messageLine1",values:{affectedFieldName:o.createElement("b",null,e.affectedFieldName),allowedFieldName:o.createElement("b",null,"NIP")}}),o.createElement(c.sA,{tagName:"p",id:"ForbiddenModal.messageLine2",values:{contactLink:o.createElement("a",{href:"mailto:[email protected]",className:m.A.linkGreen,"data-analytics":"action:forbiddenNipModalContactLink"},"[email protected]")}})),closeMethod:()=>e.onClose(),closeAfterAnyAction:!0,buttons:[{label:o.createElement(c.sA,{id:"ForbiddenModal.close"}),isPrimary:!0}]})}}a=p,i="propTypes",r={isVisible:d().bool.isRequired,affectedFieldName:d().node.isRequired,onClose:d().func.isRequired},i in a?Object.defineProperty(a,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[i]=r},54637(e,t,s){s.r(t),s.d(t,{default:()=>X});var a,i=s(70227),r=s(24809),o=s(75931),n=s(54262),d=s(62530),c=s(22417),l=(s(97496),s(18860)),m=s(47988),p=s(97665),h=s(70346),u=s(63881),f=s(20454),v=s(68445),y=s(96950),g=s(3055),b=s(76518),A=s(45025),I=(s(56448),s(80938)),x=s(7336),E=s(13150),N=s(14063),P=s(37402),O=s(83828),S=s(30789),T=s(18980),w=s(40567),D=s(94219),C=s(75743),M=s(45961),k=s(79663),L=s(17179),F=s(6066),_=s(30691),z=s(13185),j=s(18181),V=s(43537),B=s(89334),R=s(16333),U=s(18113),G=(s(1686),s(6061)),H=s(38330);function Z(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function W(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
2t%2?Z(Object(s),!0).forEach(function(t){J(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Z(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function J(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}let X=(0,o.Ng)(e=>({cart:e.cart.cartContent,availableMethods:e.cart.availableMethods,availableMethodsStatus:e.cart.availableMethodsStatus,isLoggedIn:e.account.isLoggedIn,userData:e.account.userData,userDataStatus:e.account.userDataStatus,invoiceAddressBook:e.addressBooks.invoiceAddressBook,invoiceDefaultAddressId:e.addressBooks.invoiceDefaultAddressId,isInSearchMode:e.addressBooks.invoiceIsInSearchMode}),e=>({actions:W(W({},(0,d.zH)({setInvoiceAddress:b._J,addInvoiceAddress:G.hi,setInvoiceDefaultAddressId:G.Om},e)),{},{setPaymentMethod(t,s,a){("TpaySubscription"!==t||a)&&((0,y.U)({event:"checkout",checkoutAction:"Payment Method",checkoutLabel:t}),(0,k.A)("add_payment_info",{items:[{item_id:t}]}),e((0,b.Ye)(t,s,a)))}})}))(a=(0,n.j4)(a=class extends i.Component{constructor(e){super(e),J(this,"methodsForm",{}),J(this,"methodsInvoiceAddressSelector",void 0),J(this,"paymentCardDataSet",!1),this.state={isForbiddenNIPModalVisible:!1,forbiddenNIPAffectedFieldLabel:"",invalidCardNumber:!1,invalidExpiryData:!1,invalidCvc:!1,invalidOwnerName:!1,selectedAddress:null,previousSelectedAddress:null,editMode:!1,displayEditAddressInfo:!1,isReceiptEnabled:!1,selectedProofOfPurchaseType:U.d.invoice,showSkipInvoiceAddressModal:!1,initWithDefaultAddress:!0,displayFormModal:!1,waitingForTaxIdVerification:!1}}componentDidMount(){var e,t;this.props.cart&&this.props.cart.invoiceInformation&&this.setState({selectedProofOfPurchaseType:(null===(t=this.props.cart.invoiceInformation)||void 0===t?void 0:t.proofOfPurchase)||U.d.invoice});this.props.cart&&(null===(e=this.props.cart.paymentInformation)||void 0===e?void 0:e.type)===D.d.Spingo&&this.setState({selectedProofOfPurchaseType:U.d.invoice}),I.A.addSalesmanagoCheckout(this.props.cart.cartId,"checkout_4").catch(e=>console.error("Error sending SM checkout_4 event",e))}componentDidUpdate(e){var t,s,a,i,r,o,n;e.cart&&this.props.cart&&(null===(t=e.cart.invoiceInformation)||void 0===t?void 0:t.proofOfPurchase)!==(null===(s=this.props.cart.invoiceInformation)||void 0===s?void 0:s.proofOfPurchase)&&this.setState({selectedProofOfPurchaseType:(null===(n=this.props.cart.invoiceInformation)||void 0===n?void 0:n.proofOfPurchase)||U.d.invoice});if(e.cart&&this.props.cart&&(null===(a=e.cart.paymentInformation)||void 0===a?void 0:a.type)!==D.d.Spingo&&(null===(i=this.props.cart.paymentInformation)||void 0===i?void 0:i.type)===D.d.Spingo&&this.setState({selectedProofOfPurchaseType:U.d.invoice}),this.props.isLoggedIn&&this.state.initWithDefaultAddress&&this.props.invoiceDefaultAddressId&&(null===(r=this.props.invoiceAddressBook)||void 0===r?void 0:r.length)>0&&(null===(o=this.props.cart)||void 0===o||!o.invoiceInformation)){const e=this.props.invoiceAddressBook.find(e=>e.addressId===this.props.invoiceDefaultAddressId);e&&Object.keys(e).length>0&&this.selectAddress(e),this.setState({initWithDefaultAddress:!1})}}getOrganizationId(){const e=this.props,t=e.userData;return e.userDataStatus!==g.Pu.READY?null:t.organizationId||null}addNewAddress(e){const t=this.getOrganizationId();if(null===t)return Promise.reject("No user data");m.A.saveInvoiceAddress(t,e).then(e=>{this.selectAddress(e),this.props.actions.addInvoiceAddress(e),this.methodsInvoiceAddressSelector.scrollAddressBookToBeginning(),(0,f.VX)("ns_addressBook_added")}).catch(e=>{(0,f.UG)("ne_addressBook_cantAdd",null,e)})}editExistingAddress(e){const t=this.getOrganizationId();if(null===t)return Promise.reject("No user data");m.A.editExisitingInvoiceAddress(t,e).then(e=>{this.setState({editMode:!1,displayEditAddressInfo:!1,displayFormModal:!1}),this.props.actions.addInvoiceAddress(e),this.methodsInvoiceAddressSelector.scrollAddressBookToBeginning(),(0,f.VX)("ns_addressBook_added")}).catch(e=>{(0,f.UG)("ne_addressBook_cantAdd",null,e)})}verifyEuZeroTax(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=this.props.cart;p.A.verifyEuZeroTax(e.taxIdentificationNumber).then(a=>a&&a.status?"ACCEPTED"===a.status?(this.setState({waitingForTaxIdVerification:!1}),e.euZeroTaxAgreement=!0,e.euZeroTax=!0,this.props.actions.setInvoiceAddress(s.cartId,e,()=>{r.Nc.push((0,v.B2)("route-order-summary"))})):void("PENDING"===a.status?(this.setState({waitingForTaxIdVerification:!0}
2),t<30?setTimeout(()=>{this.verifyEuZeroTax(e,t+1)},2e3):(this.setState({waitingForTaxIdVerification:!1}),(0,l.A)().captureException("Nie udaÅo siÄ zweryfikowaÄ możliwoÅci korzystania z VAT 0% w wyznaczonym czasie"),this.props.actions.setInvoiceAddress(s.cartId,e,()=>{r.Nc.push((0,v.B2)("route-order-summary"))}),(0,f.UG)("ne_euZeroTaxError"))):(this.setState({waitingForTaxIdVerification:!1}),this.props.actions.setInvoiceAddress(s.cartId,e,()=>{r.Nc.push((0,v.B2)("route-order-summary"))}),(0,f.UG)("ne_euZeroTaxError"))):(this.setState({waitingForTaxIdVerification:!1}),this.props.actions.setInvoiceAddress(s.cartId,e,()=>{r.Nc.push((0,v.B2)("route-order-summary"))}))).catch(t=>{this.setState({waitingForTaxIdVerification:!1}),(0,l.A)().captureException("Nie udaÅo siÄ zweryfikowaÄ możliwoÅci korzystania z VAT 0%",{extra:{errorMessage:t}}),this.props.actions.setInvoiceAddress(s.cartId,e,()=>{r.Nc.push((0,v.B2)("route-order-summary"))})})}onSubmit(e){const t=W({},e),s=this.props.cart,a=s&&s.paymentInformation&&s.paymentInformation.type,i=s.shipmentType===u.l5.MULTI?s.shipmentLocations:s.shipmentLocations.slice(0,1),o=i.length>0&&i.every(e=>(0,h.W)(e.countryCode)),n=(0,h.R)(t.taxIdentificationNumber),d=t.proofOfPurchase===U.d.invoice;delete t.payment,a&&(0,B.L)("EU_ZERO_VAT")&&d&&o&&n?this.verifyEuZeroTax(t):a?this.props.actions.setInvoiceAddress(s.cartId,t,()=>{r.Nc.push((0,v.B2)("route-order-summary"))}):c.XG.scrollTo("payment-methods",{smooth:!0,duration:300})}showModal(){this.props.isLoggedIn&&this.setState({showSkipInvoiceAddressModal:!0})}hideModal(){this.setState({showSkipInvoiceAddressModal:!1})}submit(){1!==this.props.cart.productCount||"prod_sub_monthly"!==this.props.cart.products[0].productId&&"prod_sub_monthly_de"!==this.props.cart.products[0].productId||!1!==this.paymentCardDataSet?this.state.selectedProofOfPurchaseType===U.d.receipt?this.onSubmit({proofOfPurchase:U.d.receipt}):this.methodsForm.submit(null,!0).then(e=>{!1===e&&this.showModal()}).catch(e=>{this.showModal()}):(0,f.UG)("Nie podano danych karty",null)}selectAddress(e){const t=W(W({},L.n),e);this.methodsForm.setValues(W({},t)),this.setState({selectedAddress:t,editMode:!1,displayEditAddressInfo:!1})}editAddress(e){const t=W(W({},L.n),e);console.log({addressToSet:t});let s=!1;t.organizationType===H.C.personal&&(t.contactPerson&&!t.firstName&&!t.lastName||t.contactPerson&&t.firstName&&!t.lastName)&&(t.firstName=t.contactPerson,s=!0),t.organizationType===H.C.company&&t.contactPerson&&!t.companyName&&(t.companyName=t.contactPerson,s=!0),(t.phoneNumber&&!t.contactPhoneNumberPrefix&&!t.contactPhoneNumberSuffix||t.phoneNumber&&!t.contactPhoneNumberPrefix&&t.contactPhoneNumberSuffix)&&(t.contactPhoneNumberSuffix=t.phoneNumber,s=!0),(t.addressLine1&&!t.street&&!t.buildingNumber||t.addressLine1&&t.street&&!t.buildingNumber)&&(t.street=t.addressLine1,s=!0),this.methodsForm.setValues(W({},t)),this.setState({selectedAddress:t,editMode:!0,displayFormModal:!0,displayEditAddressInfo:s})}setDefaultAddress(e){m.A.setInvoiceDefaultAddress(e).then(t=>{this.props.actions.setInvoiceDefaultAddressId(e),(0,f.VX)("ns_defaultAddress_added")}).catch(e=>(0,f.UG)("ne_defaultAddress_cantSet",null,e))}setAnalyticsItems(){const e=this.props;this.state;try{e.isLoggedIn&&e.userData.email?localStorage.setItem("order_email",e.userData.email):e.cart.shipmentLocations&&e.cart.shipmentLocations.length>0&&localStorage.setItem("order_email",e.cart.shipmentLocations[0].contactEmail)}catch(e){}try{e.cart.shipmentLocations&&e.cart.shipmentLocations.length>0&&localStorage.setItem("order_mobile",e.cart.shipmentLocations[0].contactPhoneNumber)}catch(e){}}savePreferredPaymentType(){try{let e=D.d.NotSelected,t=this.props.availableMethods.filter(e=>!e.disabled),s=t.filter(e=>"recommended"===e.tag);s.length>0?e=s[0].id:t.length>0&&(e=t[0].id),sessionStorage.setItem("preferredPaymentType",e)}catch(e){}}setCardData(e){if(!e.acceptTerms)return void(this.paymentCardDataSet=!1);let t={};if("new"===e.selectedCard){let s=e.newCard;if(s.ownerName=s.ownerName&&s.ownerName.trim(),s.cardNumber=s.cardNumber&&s.cardNumber.replace(/\s/g,""),s.cvc=s.cvc&&s.cvc.trim(),s.expiryDate=s.expiryDate&&s.expiryDate.trim(),""===s.cardNumber&&""===s.cvc&&""===s.expiryDate&&""===s.ownerName)return void(this.paymentCardDataSet=!1);const a=M.G.payment.cardExpiryVal(M.G.payment.formatExpiry(s.expiryDate)),i=M.G.payment.validateCardData(s,a);
2this.setState({invalidCardNumber:i.invalidCardNumber,invalidExpiryData:i.invalidExpiryData,invalidCvc:i.invalidCvc,invalidOwnerName:i.invalidOwnerName});if(Object.keys(i).some(e=>i[e]))return void(this.paymentCardDataSet=!1);let r=document.location.origin;r.indexOf("localhost")>-1&&(r="https://t37.chroma.pl/");let o=s.cardNumber+"|"+a.month+"/"+a.year+"|"+s.cvc.replace(/\s/g,"")+"|"+r;const n=r.indexOf("t37")>-1,d=M.G.encrypt(o,n);if(!1===d)return;t.card=d,t.cardNumberLastDigits=s.cardNumber.substring(12,16),t.cardId=t.cardNumberLastDigits,t.cardOwnerName=s.ownerName,t.cardExpiryDate=s.expiryDate,this.addUserCard(t)}else{let s=e.userCards.filter(t=>t.cardId===e.selectedCard)[0];t.cardId=s.cardId,t.card=s.card,t.cardNumberLastDigits=s.cardNumberLastDigits,t.cardOwnerName=s.cardOwnerName,t.cardExpiryDate=s.expiryDate}this.paymentCardDataSet=!0,this.setTempPaymentCardData(t),this.props.actions.setPaymentMethod("TpaySubscription",null,(e=>e.cardId===e.cardNumberLastDigits?{card:e.card,cardNumberLastDigits:e.cardNumberLastDigits,cardOwnerName:e.cardOwnerName,cardExpiryDate:e.cardExpiryDate}:e)(t))}addUserCard(e){let t=[];try{t=JSON.parse(localStorage.getItem("_userCards"))||[]}catch(e){}let s=!1;for(let a=0;a<t.length;a++)if(t[a].cardNumberLastDigits===e.cardNumberLastDigits){s=!0;break}s||(t.push(e),localStorage.setItem("_userCards",JSON.stringify(t)))}setTempPaymentCardData(e){try{localStorage.setItem("_initPaymentData",JSON.stringify(e))}catch(e){}}isFormHidden(e){var t;return!(!this.props.isLoggedIn||0===(null===(t=this.props.invoiceAddressBook)||void 0===t?void 0:t.length))&&(!this.state.editMode&&(this.state.selectedAddress?Boolean(this.state.selectedAddress.addressId):!(e&&Object.keys(e).length>0&&!e.addressId)))}renderForm(){var e;const t=this.props,s=this.state,a=t.cart,r=a.shipmentLocations,o=void 0===r?[]:r,n=a.shipmentType,d=a.invoiceInformation,l=void 0===d?{}:d;return i.createElement(N.A,{onSubmit:e=>this.onSubmit(e),getExposedMethods:e=>this.methodsForm=e,invoiceInformation:s.selectedAddress||l,shipmentLocations:o,shipmentType:n,allowAddressSaving:t.isLoggedIn&&(s.selectedAddress&&!s.selectedAddress.addressId||s.editMode||0===(null===(e=t.invoiceAddressBook)||void 0===e?void 0:e.length)),onAddressSave:s.editMode?this.editExistingAddress.bind(this):e=>{this.addNewAddress(e),this.setState({displayFormModal:!1}),(0,y.U)({event:"userProfile",userAction:"Invoice addition"}),(0,k.A)("user_profile",{user_action:"Invoice addition"}),c.XG.scrollTo("invoiceAddresses",{smooth:!0,duration:300,offset:-200})},editMode:s.editMode,isRebranding:!0})}render(){var e,t;const s=this.props,a=this.state;let o=s.cart,d=void 0===o?{}:o,l=d.products,m=d.paymentInformation,p=void 0===m?{}:m,h=p.email,u=p.type,f=d.invoiceInformation,y=void 0===f?{}:f;this.savePreferredPaymentType(),this.setAnalyticsItems();const b=l&&l.length>0&&(null===(e=l[0].productId)||void 0===e?void 0:e.indexOf("prod_sub_"))>-1,I=l&&l.length>0&&(null===(t=l[0].productId)||void 0===t?void 0:t.indexOf("sub_monthly"))>-1;return i.createElement("section",{className:"py-8 lg:py-12 1xl:pt-8 1xl:pb-12 text-chroma-black lg:max-w-screen-lg 1xl:max-w-screen-1xl mx-auto"},i.createElement("div",{className:"1xl:flex 1xl:justify-between 1xl:gap-4 w-full 1xl:max-w-7xl mx-auto"},i.createElement("div",{className:"flex flex-col gap-8 lg:gap-12 w-full lg:w-[824px] 1xl:w-[728px] max-1xl:mx-auto lg:pb-12"},i.createElement(c.Hg,{className:"flex flex-col gap-8 lg:gap-12 pb-8 lg:pb-12 border-b border-chroma-black-20",name:"payment-methods"},i.createElement("div",{className:"1xl:desktop-title-s mobile-title-s"},i.createElement(n.sA,{id:"InvoiceAddressAndPayment.paymentMethod"})),[g.Pu.LOADING,g.Pu.INIT].includes(s.availableMethodsStatus)&&i.createElement(E.A,null),s.availableMethodsStatus===g.Pu.READY&&!I&&i.createElement(x.A,{availablePaymentTypes:s.availableMethods,selectedPaymentType:u,paymentEmail:h,onChange:(e,t)=>
2s.actions.setPaymentMethod(e,t)}),s.availableMethodsStatus===g.Pu.READY&&I&&i.createElement(C.A,{invalidCardNumber:this.state.invalidCardNumber,invalidExpiryData:this.state.invalidExpiryData,invalidCvc:this.state.invalidCvc,invalidOwnerName:this.state.invalidOwnerName,onChangeCardData:e=>{this.setCardData(e)}})),(0,B.L)("PROOF_OF_PURCHASE")&&this.state.isReceiptEnabled&&u!==D.d.Spingo&&i.createElement("div",{className:"flex flex-col gap-8"},i.createElement("div",{className:"1xl:desktop-title-s mobile-title-s"},i.createElement(n.sA,{id:"ProofOfPurchase.label"})),i.createElement("div",{className:this.state.selectedProofOfPurchaseType!==U.d.receipt?"pb-8 lg:pb-16 border-b border-chroma-black-20":""},i.createElement(R.A,{options:[{label:i.createElement(n.sA,{id:"ProofOfPurchase.type.invoice"}),value:U.d.invoice},{label:i.createElement(n.sA,{id:"ProofOfPurchase.type.receipt"}),value:U.d.receipt}],selectedValue:this.state.selectedProofOfPurchaseType,onChange:e=>{e===U.d.receipt&&this.setState({editMode:!1,displayEditAddressInfo:!1}),this.setState({selectedProofOfPurchaseType:e})},isRebranding:!0}))),this.props.isLoggedIn&&this.state.selectedProofOfPurchaseType!==U.d.receipt&&i.createElement("div",{id:"invoiceAddresses",className:"flex flex-col gap-8 empty:hidden"},i.createElement("div",{className:"flex flex-wrap gap-2 items-center justify-between"},i.createElement("div",{className:"1xl:desktop-title-s mobile-title-s"},i.createElement(n.sA,{id:"InvoiceAddress.savedAdresses"})),i.createElement("div",{className:"flex gap-[6px] items-center cursor-pointer mobile-paragraph-m-medium lg:desktop-paragraph-l-medium hover:underline",onClick:()=>{this.selectAddress(W({},L.n)),this.setState({previousSelectedAddress:this.state.selectedAddress,displayFormModal:!0})}},i.createElement(_.A,{id:"PLUS"}),i.createElement(n.sA,{id:"Common.addNewAddress"}))),i.createElement(P.A,{selectedAddress:this.state.selectedAddress||y,onSelect:this.selectAddress.bind(this),onEdit:this.editAddress.bind(this),getExposedMethods:e=>this.methodsInvoiceAddressSelector=e,onSetDefaultAddress:this.setDefaultAddress.bind(this)})),this.state.selectedProofOfPurchaseType===U.d.invoice&&!this.props.isLoggedIn&&i.createElement("div",{className:"flex flex-col gap-8"},i.createElement("div",{className:"1xl:desktop-title-s mobile-title-s"},i.createElement(n.sA,{id:"Common.invoiceData"})),this.state.displayEditAddressInfo&&i.createElement(j.A,{className:"mt-12",addressType:V.R.invoice}),this.renderForm()),this.state.selectedProofOfPurchaseType===U.d.invoice&&this.props.isLoggedIn&&i.createElement(T.A,{attachToBody:!0,modalId:"addOrEditInvoiceAddressModal",className:"1xl:w-[846px] md:w-[688px]",isVisible:this.state.displayFormModal,title:this.state.editMode?i.createElement(n.sA,{id:"Common.editAddress"}):i.createElement(n.sA,{id:"Common.addNewAddress"}),closeMethod:()=>{this.state.editMode?this.selectAddress(this.state.selectedAddress):this.selectAddress(this.state.previousSelectedAddress),this.setState({displayFormModal:!1})},preventBackdropClose:!0,message:i.createElement(i.Fragment,null,this.state.displayEditAddressInfo&&i.createElement(j.A,{className:"mb-8",addressType:V.R.invoice}),this.renderForm())})),i.createElement("div",{className:"max-1xl:w-full max-1xl:flex max-1xl:justify-end max-lg:mt-8 lg:max-1xl:mt-12"},i.createElement(F.A,{className:"1xl:sticky 1xl:top-0",bottomSlot:i.createElement("div",{className:"flex flex-col lg:max-1xl:flex-row lg:max-1xl:w-full lg:max-1xl:justify-end gap-4"},i.createElement(z.A,{className:"lg:max-1xl:order-2",size:"m",onClick:()=>this.submit(),testid:"acceptInvoice",analyticsid:"acceptInvoice"},i.createElement(n.sA,{id:"Order.step.summary"})),i.createElement(T.A,{modalId:"skipInvoiceAddressModal",isVisible:this.state.showSkipInvoiceAddressModal,title:i.createElement(S.A,{type:"alert"},i.createElement(n.sA,{id:"Common.alert"})),message:i.createElement(n.sA,{id:"InvoiceAddressAndPayment.skipInvoiceAddressModal.message"}),isCloseButtonVisible:!0,attachToBody:!0,closeMethod:()=>this.hideModal(),buttons:[{label:i.createElement(n.sA,{id:"Common.no"}),closeAfterAction:!0,isPrimary:!1},{label:i.createElement(n.sA,{id:"Common.yes"}),onClick:()=>{this.hideModal(),r.Nc.push((0,v.B2)("route-order-summary"))},isPrimary:!0}]}))}))),i.createElement(r.N_,{to:(0,v.B2)(b?"route-order-cart":"route-order-shipment-address"),onClick:e=>(0,A.Zf)()&&b&&e.preventDefault(),className:"mt-8 lg:mt-12 inline-flex items-center justify-center gap-1 self-start",analyticsid:b?"backToOrder":"backToShipment"},i.createElement(_.A,{id:"CHEVRON_LEFT"}),i.createElement("div",{className:"mobile-paragraph-m-medium 1xl:desktop-paragraph-m-medium hover:underline"},b?i.createElement(n.sA,{id:"Order.backToOrdersList"}):i.createElement(n.sA,{id:"Order.backToShipment"}))),i.createElement(O.A,{isVisible:a.isForbiddenNIPModalVisible,affectedFieldName:a.forbiddenNIPAffectedFieldLabel,onClose:()=>this.setState({isForbiddenNIPModalVisible:!1})}),i.createElement(w.A,{isHidden:!a.waitingForTaxIdVerification},i.createElement("span",{className:"mobile-paragraph-l-medium"},i.createElement(n.sA,{id:"Invoices.taxIdVerification"}))))}})||a)||a},70346(e,t,s){s.d(t,{R:()=>r,W:()=>i});var a=s(2498);function i(e){return a.wo.includes(e)}function r(e){return!!e&&!/^PL/i.test(e)&&/^[A-Z]{2}.{6,}/i.test(e)}}}]);
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.