{"version":3,"sources":["constants/billing.tsx","constants/giftcard.tsx","constants/pages.tsx","constants/regions.tsx","constants/validation.tsx","constants/terms.tsx","constants/reload.tsx","constants/errorcodes.tsx","utils/common.utils.tsx","utils/creditcard.utils.tsx","utils/payment.utils.tsx","constants/index.tsx","components/Style.tsx","actions/settings.actions.tsx","actions/regions.actions.tsx","actions/giftcard.actions.tsx","actions/language.actions.tsx","actions/billing.actions.tsx","actions/configuration.actions.tsx","components/ErrorMessage.tsx","components/Field.tsx","components/ContactUsSection.tsx","components/PageNavigation.tsx","components/RecaptchaField.tsx","components/Button.tsx","containers/GiftCardInformation/index.tsx","components/ExpirationDateField.tsx","components/CreditCardIssuer.tsx","hooks/RoverFocus.tsx","hooks/Validation.tsx","components/FieldPaysafe.tsx","containers/PaymentInformation/CreditCardInformation.tsx","components/SelectField.tsx","components/RegionsField.tsx","containers/PaymentInformation/BillingInformation.tsx","containers/PaymentInformation/PurchaserInformation.tsx","containers/PaymentInformation/index.tsx","components/HalfButton.tsx","components/AmountSelectionField.tsx","containers/AmountSelection/index.tsx","components/Terms.tsx","components/OptIn.tsx","containers/OrderSummary/index.tsx","containers/OrderConfirmation/index.tsx","containers/Error/index.tsx","containers/previews/GiftCardInformationPreview/index.tsx","containers/previews/PaymentInformationPreview/CreditCardInformationPreview.tsx","containers/previews/PaymentInformationPreview/BillingInformationPreview.tsx","containers/previews/PaymentInformationPreview/PurchaserInformationPreview.tsx","containers/previews/PaymentInformationPreview/index.tsx","containers/previews/AmountSelectionPreview/index.tsx","containers/previews/OrderSummaryPreview/index.tsx","containers/previews/OrderConfirmationPreview/index.tsx","containers/previews/ErrorPreview/index.tsx","components/PageSelector.tsx","components/PreviewPageSelector.tsx","components/Header.tsx","components/Footer.tsx","containers/App.tsx","serviceWorker.ts","reducers/configuration.reducer.tsx","reducers/settings.reducer.tsx","reducers/billing.reducer.tsx","reducers/regions.reducer.tsx","reducers/giftcard.reducer.tsx","reducers/language.reducer.tsx","reducers/index.tsx","store/index.tsx","index.tsx"],"names":["issuer","number","name","expirationDate","cvd","address","address2","city","country","region","zipCode","phoneNumber","email","optIn","cardNumber","cardExpiry","cardCVC","paysafeSingleUseToken","pendingAuthorizationId","creditCardSession","cardPin","cardReloadAmount","recaptchaResponse","cardBalance","orderNumber","GIFT_CARD_INFORMATION","PAYMENT_INFORMATION","AMOUNT_SELECTION","ORDER_SUMMARY","ORDER_CONFIRMATION","ERROR","provincesCountriesIds","statesCountriesIds","countiesCountriesIds","zipCodeCountriesIds","noPostalCodeCountriesIds","canadaId","max50","numeric","zipcode","required","creditcard","postalcode","tc_required","phonenumber","regions","buyatabTerms","clientTerms","amount","reloadSessionId","returnUrl","defaultErrorCode","removeNonNumeric","value","replace","addLeadingZero","num","size","s","String","length","getClientId","window","location","pathname","slice","getReturnUrl","pageName","operationValue","getUrlParam","reload","href","urlToRedirect","decodeURIComponent","includes","enforceNumber","theNumber","parseInt","formatCurrency","languageIso","currency","Number","isNaN","toLocaleString","style","formatNumbers","clearValue","nextValue","index","trim","rangeArray","start","end","Array","from","v","k","isEmpty","obj","Object","entries","constructor","getLastFourCharacters","source","creditCardNumber","creditCardLength","substring","getExpirationDate","date","year","month","param","results","RegExp","exec","decodeURI","useCurrencyPosition","currencySign","currencyPosition","useSelector","state","configuration","culture","currencyPositionId","isNonEmptyString","formatCreditCardNumber","Payment","fns","cardType","formatCVC","getRegionLabel","countryId","language","province","county","generic","hasProvinces","hasStates","hasCounties","getZipLabel","zip","postal","hasZipcode","getZipValidationType","hasNoPostalcode","validationType","some","id","formatZipCode","lastChar","toLocaleUpperCase","isOdd","match","CLIENT_ID","SHOW_GDPR","showGdpr","getShowGdpr","RELOAD_SESSION_ID","API","GET_CONFIGURATION_URL","GET_PREVIEW_CONFIGURATION_URL","GET_REGIONS_URL","VERIFY_CARD_URL","SUBMIT_ORDER_URL","SUCCESS_RESPONSE","RECAPTCHA_FAILED","CARD_VERIFICATION_FAILED","SVS_CARD_VERIFICATION_FAILED","INVALID_OR_EXPIRED_SESSION_ID","UNABLE_TO_FIND_MAPPED_RELOAD_SESSION_ID","INVALID_STOREFRONTCODE_MAPPING","SUBMIT_ORDER_FAILED","AUTHENTICATION_FAILED","NOT_A_RELOAD_STOREFRONT","REQUEST_ATTEMPTS","EMAIL_VALIDATION_URL","NOTIFY_PURCHASE_FAILURE_URL","CREATE_CREDIT_CARD_SESSION","cssUrl","link","document","createElement","setAttribute","getElementsByTagName","appendChild","setCurrentPage","page","type","payload","setContrastMode","active","getRegions","languageCode","attempts","dispatch","getState","requestHeaders","method","headers","Authorization","token","fetch","then","res","a","status","URIError","json","countryList","catch","error","refreshToken","console","pages","setGiftCardInfo","giftCardInfo","notifyUser","notificationData","authetication","requestOptions","body","JSON","stringify","setLanguage","languageContent","setBillingInfo","billingInfo","callback","loadCSS","setStyle","mode","Error","setTimeout","addGTMContainer","analyticsId","TagManager","initialize","gtmId","getCountryById","countries","find","addRiskifiedBeacon","beaconKey","storeDomain","values","DOMAIN","KEY","url","matched","async","src","x","parentNode","insertBefore","addSignifydBeacon","sessionId","target","rel","alt","lang","Field","field","isInvalid","validationError","errorMessage","message","className","htmlFor","label","aria-describedby","aria-required","defaultValue","onChange","handleChange","renderKey","key","autoComplete","classes","placeholder","pattern","validation","ref","isDisabled","detail","defaultProps","React","memo","ContactUsSection","props","storefront","contactNumber","supportEmail","dangerouslySetInnerHTML","__html","footer","support_phone","hasCustomFooter","handleKeyPress","event","keyCode","click","getLabel","querySelector","innerHTML","errors","displayErrors","errorRef","useRef","useEffect","current","focus","tabIndex","aria-live","title","keys","map","labels","innerText","uniqid","role","onKeyDown","buttons","RecaptchaField","recaptchaRef","sitekey","siteKey","badge","hl","button","isPrimary","isLeft","handleOnClick","testRole","onClick","disabled","data-test-role","useDispatch","giftCard","useForm","submitFocusError","register","triggerValidation","setError","clearError","showPin","isPinRequired","useState","disableButton","setDisableButton","isRecaptchaValid","setIsRecaptchaValid","recaptchaToken","setRecaptchaToken","isPageValid","setIsPageValid","setDisplayErrors","createRef","callingApi","setCallingApi","componentIsMounted","showContrastToggle","reloadCardSession","callVerifyCard","cardInfo","cardInformation","storeFrontCode","verifyCard","errorCallback","balance","recaptcha_error","card_verification_failed","handleFieldChange","useCallback","checkValidation","reset","execute","referrer","getValue","gift_card_info","page_title","gift_card","fields","pin","recaptcha","maskedCardNumber","hasMaskedCardNumber","aria-labelledby","section_title","legend_description","form_message","PageNavigation","error_summary_title","Button","margin","page_navigation","next_button_label","monthsOptions","startingMonth","months","thisMonth","startingYear","setMonths","thisYear","expirationDateRef","setIssuer","useRoveFocus","currentFocus","setCurrentFocus","handleKeyDown","preventDefault","addEventListener","removeEventListener","useCreditCardValidation","validateCardNumber","FieldPaysafe","billing","serverDate","cvdUrl","externalLinks","credit_card","payment_info","expiration_date","isTokenPayment","paymentConfiguration","handleExpirationDateChange","selectedMonth","selectedYear","CreditCardIssuer","localStorage","setItem","validationForm","validate","aria-label","aria_description","options","setOptions","option","theOptions","defaultOptionLabel","unshift","billingCountry","defaultCountry","billingCountries","billing_info","zip_postal","validationRules","zipcodePattern","setZipcodePattern","handleSelectChange","handleRegionsChange","tagName","nativeEvent","selectedIndex","text","expression","regionValidate","purchaser","phone_number","validateEmail","emailInfo","emailAddress","response","data","isValid","setPaysafeSingleUseToken","callPaysafe","setCallPaysafe","didCallPaysafe","setDidCallPaysafe","isPaymentGateWayEnabled","setIsPaymentGateWayEnabled","callPaymentGateway","setCallPaymentGateway","accessibleToggle","settings","useMemo","paymentGateway","isEnabled","styleUrl","computedStyle","getComputedStyle","styleObject","color","opacity","textDecoration","fontStyle","fontWeight","fontSize","lineHeight","fontFamily","invalidColor","creditCardSessionId","paramObj","origin","requestOrigin","baseStyle","cart","cartTotal","hasBackFeature","customCss","gatewayUrl","paymentGatewayUrl","accessibleStyleUrl","accessibleOptions","isAccessible","applyAccessibleStyle","evt","creditCardName","nameOnCard","creditCardEmail","creditCardExpirationDate","expiryMonth","expiryYear","creditCardZipCode","last4","prototype","finalize","sessionUniqueId","purchaserEmail","PurchaserEmail","paymentAuthorizationId","errorCode","ErrorCode","errorcodes","ErrorMessage","order","processing_failed","details","err","log","processing","setAccessibleOptions","setCustomCss","isTokenizationAvailable","isAllFieldsValid","orderData","creditCardType","phone","addressLine1","addressLine2","postalZip","regionId","regionName","reloadAmount","creditCardRegion","data-page","data-step","CreditCardInformation","BillingInformation","PurchaserInformation","back_button_label","val","setFocus","currencyCode","handleSelect","buttonRef","valLabel","maximumValue","minimumValue","description","range","data-validation","onBlur","handleBlur","onFocus","handleFocus","legend","HalfButton","AmountSelection","defaultAmount","denominationRange","amount_info","amountIsOverMax","parseFloat","amountIsUnderMin","ok","amount_under_min","exceeds_max_amount","gift_card_number","maximum_amount","AmountSelectionField","initialAmount","belowMinimum","aboveMaximum","Terms","terms","isCheckboxVisible","wrapClass","OptIn","isOptInEnabled","OrderSummary","isOptInChecked","setOptInChecked","order_summary","summary","buyatabTermsChecked","setBuyatabTermsChecked","clientTermsChecked","setClientTermsChecked","termsAndConditions","buyatabLabel","storefrontLabel","shouldDisplayStoreFrontTerms","isCheckboxRequired","optInHtml","callSubmitOrder","billingData","undefined","getItem","singleUseToken","card","cartToken","riskifiedInfo","riskifiedBeaconKey","storefrontCode","signifydBeaconKey","submitOrder","orderInfo","successCallback","current_balance","reload_amount","new_balance","ending_in","expiry_date","email_address","getRegionName","newValue","checkout_button_label","order_confirmation","orderConfirmData","storefrontName","sku","category","price","quantity","enhancedData","brand","variant","push","order_number","reload_another_card_button_label","error_page","page_body","reload_button_label","CreditCardInformationPreview","BillingInformationPreview","PurchaserInformationPreview","GiftCardInformation","PaymentInformation","OrderConfirmation","GiftCardInformationPreview","PaymentInformationPreview","AmountSelectionPreview","OrderSummaryPreview","OrderConfirmationPreview","ErrorPreview","Header","buttonLabel","secureUrl","secure_note","buyatab_rights","App","loading","setLoading","setPageHeight","html","documentElement","height","parent","postMessage","triggerResizeEvent","Math","max","scrollHeight","offsetHeight","clientHeight","MutationObserver","list","CustomEvent","dispatchEvent","observe","attributes","childList","subtree","isAbortIconVisible","currentPage","removeItem","search","useLocation","luid","URLSearchParams","get","previewMode","version","headerContent","main_title","isValidPageName","urlToRedirectTo","assign","xmlns","viewBox","d","parse","getPreviewConfiguration","getElementById","classList","add","buyatabGTMContainer","containerId","cookiePolicyProvider","buyatabCookiePolicy","clientCookiePolicy","cookiebot","chatType","zendeskLiveChat","conectysLiveChat","riskifiedStoreDomain","header","contrast_button_label","PreviewPageSelector","Footer","PageSelector","Boolean","hostname","initialState","urlReferrer","setHtmlClass","accessible","myHtml","remove","valid","combineReducers","middleware","thunk","history","createBrowserHistory","store","createStore","rootReducer","applyMiddleware","ReactDOM","render","navigator","serviceWorker","ready","registration","unregister"],"mappings":"8vFAAaA,EAAU,mBACVC,EAAU,mBACVC,EAAQ,iBACRC,EAAkB,2BAClBC,EAAO,gBACPC,EAAW,oBACXC,EAAY,qBACZC,EAAQ,iBACRC,EAAW,oBACXC,EAAU,mBACVC,EAAW,oBACXC,EAAe,wBACfC,EAAQ,kBACRC,EAAQ,QACRC,EAAa,aACbC,EAAa,aACbC,EAAU,UACVC,EAAwB,wBACxBC,EAAyB,yBACzBC,EAAoB,oBCnBpBL,EAAa,iBACbM,EAAU,cACVC,EAAmB,mBACnBC,EAAoB,oBACpBC,EAAc,cACdC,EAAc,cCLdC,EAAwB,sBACxBC,EAAsB,qBACtBC,EAAmB,kBACnBC,EAAgB,eAChBC,EAAqB,oBACrBC,GAAQ,QCJRC,GAAwB,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAIrUC,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AAS4gB,eAAe,mBTqHxB,kBAAmBsC,WACrBA,UAAUC,cAAcC,MAAM9hB,MAAK,SAAA+hB,GACjCA,EAAaC,kB","file":"static/js/main.581e2a23.chunk.js","sourcesContent":["export const issuer = 'creditCardIssuer'\r\nexport const number = 'creditCardNumber'\r\nexport const name = 'creditCardName'\r\nexport const expirationDate = 'creditCardExpirationDate'\r\nexport const cvd = 'creditCardCvd'\r\nexport const address = 'creditCardAddress'\r\nexport const address2 = 'creditCardAddress2'\r\nexport const city = 'creditCardCity'\r\nexport const country = 'creditCardCountry'\r\nexport const region = 'creditCardRegion'\r\nexport const zipCode = 'creditCardZipCode'\r\nexport const phoneNumber = 'creditCardPhoneNumber'\r\nexport const email = 'creditCardEmail'\r\nexport const optIn = 'optIn'\r\nexport const cardNumber = 'cardNumber'\r\nexport const cardExpiry = 'cardExpiry'\r\nexport const cardCVC = 'cardCVC'\r\nexport const paysafeSingleUseToken = 'paysafeSingleUseToken'\r\nexport const pendingAuthorizationId = 'pendingAuthorizationId'\r\nexport const creditCardSession = 'creditCardSession'","export const cardNumber = \"giftCardNumber\"\r\nexport const cardPin = \"giftCardPin\"\r\nexport const cardReloadAmount = \"cardReloadAmount\"\r\nexport const recaptchaResponse = \"recaptchaResponse\"\r\nexport const cardBalance = \"cardBalance\"\r\nexport const orderNumber = \"orderNumber\"","export const GIFT_CARD_INFORMATION = \"GiftCardInformation\"\r\nexport const PAYMENT_INFORMATION = \"PaymentInformation\" \r\nexport const AMOUNT_SELECTION = \"AmountSelection\" \r\nexport const ORDER_SUMMARY = \"OrderSummary\" \r\nexport const ORDER_CONFIRMATION = \"OrderConfirmation\" \r\nexport const ERROR = \"Error\" \r\n\r\nexport type PageNames = typeof GIFT_CARD_INFORMATION | typeof PAYMENT_INFORMATION | typeof AMOUNT_SELECTION | typeof ORDER_SUMMARY | typeof ORDER_CONFIRMATION;","// list of countries with provinces (ID)\r\nexport const provincesCountriesIds = [\"CA\", \"AF\", \"DZ\", \"AO\", \"AR\", \"BE\", \"BO\", \"BG\", \"BF\", \"BI\", \"CL\", \"CN\", \"CD\", \"CR\", \"CU\", \"DO\", \"EC\", \"GQ\", \"FJ\", \"FI\", \"GA\", \"GE\", \"GR\", \"IE\", \"IT\", \"KE\", \"MG\", \"MN\", \"MZ\", \"NP\", \"NL\", \"NO\", \"OM\", \"PK\", \"PA\", \"PE\", \"PH\", \"RO\", \"SA\", \"ZA\", \"ES\", \"LK\", \"SR\", \"TH\", \"TO\", \"TR\", \"TM\", \"UA\", \"VU\", \"ZM\", \"ZW\"]\r\n\r\n\r\n// list of countries with states (ID)\r\nexport const statesCountriesIds = [\"US\", \"AU\", \"AT\", \"BR\", \"DE\", \"IN\", \"MY\", \"MX\", \"FM\", \"VE\"]\r\n\r\n// list of countries with counties (ID). All the ones not included in the lists should fall into generic type\r\nexport const countiesCountriesIds = [\"GB\", \"IE\", \"LR\"]\r\n\r\n// list of countries using zipcode\r\nexport const zipCodeCountriesIds = [\"US\", \"PH\"]\r\n\r\n// list of countries with no postal or zip code (for validation)\r\nexport const noPostalCodeCountriesIds = [\"AO\", \"AG\", \"AW\", \"BS\", \"BZ\", \"BJ\", \"BW\", \"BF\", \"BI\", \"CM\", \"KM\", \"CG\", \"CD\", \"CK\", \"CI\", \"DJ\", \"DM\", \"GQ\", \"ER\", \"FJ\", \"GM\", \"GD\", \"GN\", \"GY\", \"KI\", \"MO\", \"MW\", \"ML\", \"MR\", \"MU\", \"MS\", \"NR\", \"AN\", \"NU\", \"QA\", \"KN\", \"LC\", \"ST\", \"SC\", \"SB\", \"SR\", \"SY\", \"TZ\", \"TK\", \"TO\", \"TT\", \"TV\", \"AE\", \"VU\", \"YE\", \"ZW\"]\r\n\r\nexport const canadaId = \"CA\"","export const email = 'email'\r\nexport const max50 = 'max50'\r\nexport const numeric = 'numeric'\r\nexport const zipcode = 'zipcode'\r\nexport const required = 'required'\r\nexport const creditcard = 'creditcard'\r\nexport const postalcode = 'postalcode'\r\nexport const tc_required = 'tc_required'\r\nexport const phonenumber = 'phonenumber'\r\nexport const regions = 'select_region'\r\n","export const buyatabTerms = \"buyatabTerms\"\r\nexport const clientTerms = \"clientTerms\"","export const amount = 'card_value' //needs to be this value for Css\r\nexport const reloadSessionId = \"session_id\" \r\nexport const returnUrl = \"returnUrl\"","export const defaultErrorCode = \"204\"","import { useSelector } from \"react-redux\";\r\nimport { reload } from \"../constants\";\r\nimport { AMOUNT_SELECTION, GIFT_CARD_INFORMATION, ORDER_CONFIRMATION, ORDER_SUMMARY, PageNames, PAYMENT_INFORMATION } from \"../constants/pages\";\r\n\r\n//removes all the non-numeric characters from the string\r\nexport const removeNonNumeric = (value: string = \"\") => {\r\n if (typeof value !== \"string\") {\r\n return value;\r\n }\r\n return value.replace(/\\D+/g, \"\");\r\n};\r\n\r\n// adds leading zeroes to a number\r\nexport const addLeadingZero = (num: number, size: number = 2) => {\r\n var s = String(num);\r\n while (s.length < size) {\r\n s = \"0\" + s;\r\n }\r\n return s;\r\n};\r\n\r\n//returns the client id from the url\r\nexport const getClientId = () => {\r\n return window.location.pathname.slice(1) || 0;\r\n};\r\n\r\n//returns the reload session id from the url\r\nexport const getReloadSessionId = () => {\r\n return getUrlParam(reload.reloadSessionId, window.location.href);\r\n};\r\n\r\nexport const getReturnUrl = (pageName: PageNames) => {\r\n const operationValue = pageName !== 'OrderConfirmation' ? 'abort': 'complete'\r\n const returnUrl = getUrlParam(reload.returnUrl, window.location.href);\r\n if(returnUrl){\r\n const urlToRedirect = decodeURIComponent(returnUrl);\r\n const finalUrl = urlToRedirect.includes(\"?\") ? `${urlToRedirect}&operation=${operationValue}`: `${urlToRedirect}/?operation=${operationValue}`\r\n return finalUrl;\r\n }\r\n return \"#\"\r\n}\r\n\r\nexport const isValidPageName = (pageName: unknown): pageName is PageNames => {\r\n switch (pageName) {\r\n case GIFT_CARD_INFORMATION:\r\n case PAYMENT_INFORMATION:\r\n case AMOUNT_SELECTION:\r\n case ORDER_SUMMARY:\r\n case ORDER_CONFIRMATION:\r\n return true\r\n default:\r\n return false\r\n }\r\n}\r\n\r\n//returns the showGdpr parameter, the default value is true\r\nexport const getShowGdpr = () => {\r\n const showGdpr = getUrlParam(\"showGdpr\", window.location.href);\r\n\r\n if (showGdpr == null) return true;\r\n return showGdpr === \"true\";\r\n};\r\n\r\n//returns true if the page is loaded in an iframe\r\nexport const isInIframe = () => {\r\n return window.location !== window.parent.location;\r\n};\r\n\r\nexport const enforceNumber = (theNumber: number | string) => {\r\n if (typeof theNumber == \"string\") {\r\n theNumber = parseInt(theNumber);\r\n }\r\n\r\n return theNumber;\r\n};\r\n\r\nexport const formatCurrency = (value: string | number, languageIso: string = \"en\", currency: string = \"USD\") => {\r\n value = enforceNumber(value);\r\n\r\n if (Number.isNaN(value)) return \"\";\r\n\r\n return value.toLocaleString(languageIso, {\r\n style: \"decimal\",\r\n currency,\r\n });\r\n};\r\n\r\nexport const formatNumbers = (value: string) => {\r\n const clearValue = removeNonNumeric(value);\r\n let nextValue = \"\";\r\n\r\n for (let index = 1; index < 12; index++) {\r\n nextValue = nextValue + `${clearValue.slice(4 * index - 4, 4 * index)} `;\r\n }\r\n\r\n return nextValue.trim();\r\n};\r\n\r\n//return string shorter than 50 chars\r\nexport const max50 = (value: string) => {\r\n return value.slice(0, 50);\r\n};\r\n\r\n// return array with numbers in the provided range\r\nexport const rangeArray = (start: number, end: number) => Array.from({ length: end - start }, (v, k) => k + start);\r\n\r\n// check if object is empty\r\nexport const isEmpty = (obj: Record) => Object.entries(obj).length === 0 && obj.constructor === Object;\r\n\r\nexport const getLastFourCharacters = (source: String) => {\r\n var creditCardNumber = source.replace(/\\s/g, \"\");\r\n var creditCardLength = creditCardNumber.length;\r\n\r\n return creditCardNumber.substring(creditCardLength - 4);\r\n};\r\n\r\nexport const getExpirationDate = (date: any) => {\r\n if (!date.year || !date.month) return;\r\n return `${addLeadingZero(date.month, 2)}/${date.year}`;\r\n};\r\n\r\nexport const getRegionName = (region: any) => {\r\n return region.name ? region.name : \"\";\r\n};\r\n\r\nexport const getUrlParam = (param: String, location: string) => {\r\n var results = new RegExp(\"[?&]\" + param + \"=([^&#]*)\").exec(location);\r\n if (results == null) {\r\n return null;\r\n } else {\r\n return decodeURI(results[1]) || 0;\r\n }\r\n};\r\n\r\n// triggers a resize event which is detected by the parent.js file\r\n// and used to resize iframe according to content\r\nexport const triggerResizeEvent = (height: number) => {\r\n try {\r\n window.parent.postMessage({ type: \"resize\", value: height }, \"*\");\r\n window.parent.postMessage(height, \"*\");\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n};\r\n\r\nexport const useCurrencyPosition = (amount: string, currencySign: string) => {\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const currencyPosition = configuration.culture.currencyPositionId;\r\n let totalAmount = \"\";\r\n if (typeof currencyPosition === \"undefined\" || !currencyPosition) {\r\n totalAmount = currencySign + amount;\r\n return totalAmount;\r\n } else if (currencyPosition === 2) {\r\n totalAmount = amount + currencySign;\r\n } else {\r\n totalAmount = currencySign + amount;\r\n }\r\n return totalAmount;\r\n};\r\n\r\nexport const isNonEmptyString = (value: any) => typeof value === \"string\" && value !== null && value.trim() !== \"\";\r\n","import Payment from 'payment'\r\nimport { removeNonNumeric } from './common.utils'\r\n\r\n//formats the string by adding spaces according to the issuer \r\nexport const formatCreditCardNumber = (value: string) => {\r\n\r\n if (!value) {\r\n return value\r\n }\r\n\r\n const issuer = Payment.fns.cardType(value)\r\n const clearValue = removeNonNumeric(value)\r\n let nextValue: string\r\n\r\n switch (issuer) {\r\n case 'amex':\r\n nextValue = `${clearValue.slice(0, 4)} ${clearValue.slice(\r\n 4,\r\n 10,\r\n )} ${clearValue.slice(10, 15)}`\r\n break\r\n case 'dinersclub':\r\n nextValue = `${clearValue.slice(0, 4)} ${clearValue.slice(\r\n 4,\r\n 10,\r\n )} ${clearValue.slice(10, 14)}`\r\n break\r\n default:\r\n nextValue = `${clearValue.slice(0, 4)} ${clearValue.slice(\r\n 4,\r\n 8,\r\n )} ${clearValue.slice(8, 12)} ${clearValue.slice(12, 19)}`\r\n break\r\n }\r\n\r\n return nextValue.trim()\r\n}\r\n\r\n//limits the string to CVC max length\r\nexport const formatCVC = (value: string) => {\r\n const clearValue = removeNonNumeric(value)\r\n return clearValue.slice(0, 4)\r\n}","import { regions, validationType } from \"../constants\";\r\nimport { removeNonNumeric } from \"./common.utils\";\r\n\r\nexport const getRegionLabel = (countryId: string, language: any) => {\r\n\r\n\tconst { state, province, county, generic } = language\r\n\r\n\r\n\tif (hasProvinces(countryId)){\r\n\t\treturn province\r\n\t} else if (hasStates(countryId)){\r\n\t\treturn state\r\n\t} else if (hasCounties(countryId)){\r\n\t\treturn county\r\n\t} else {\r\n\t\treturn generic\r\n\t}\r\n}\r\n\r\nexport const getZipLabel = (countryId: string, language: any) => {\r\n\r\n\tconst { zip, postal } = language\r\n\r\n\r\n\tif (hasZipcode(countryId)) {\r\n\t\treturn zip\r\n\t}\r\n\r\n\treturn postal\r\n}\r\n\r\nexport const getZipValidationType = (countryId: string = \"USA\") => {\r\n\r\n\r\n\tif(hasNoPostalcode(countryId)) return ''\r\n\r\n if(hasZipcode(countryId)) return validationType.zipcode\r\n\r\n if(countryId === regions.canadaId) return validationType.postalcode\r\n\r\n\treturn ''\r\n\r\n}\r\n\r\nconst hasProvinces = (countryId: string) => {\r\n\tlet hasProvinces = false\r\n\r\n\tif(regions.provincesCountriesIds.some(id => id === countryId)) {\r\n\t\thasProvinces = true\r\n\t}\r\n\r\n\treturn hasProvinces\r\n}\r\n\r\nconst hasStates = (countryId: string) => {\r\n\tlet hasStates = false\r\n\r\n\tif(regions.statesCountriesIds.some(id => id === countryId)) {\r\n\t\thasStates = true\r\n\t}\r\n\r\n\treturn hasStates\r\n}\r\n\r\nconst hasCounties = (countryId: string) => {\r\n\tlet hasCounties = false\r\n\r\n\tif(regions.countiesCountriesIds.some(id => id === countryId)) {\r\n\t\thasCounties = true\r\n\t}\r\n\r\n\treturn hasCounties\r\n}\r\n\r\nconst hasZipcode = (countryId: string) => {\r\n\tif(regions.zipCodeCountriesIds.some(id => id === countryId)) {\r\n\t\treturn true\r\n\t}\r\n\r\n\treturn false\r\n}\r\nexport const hasNoPostalcode = (countryId: string) => {\r\n\r\n\r\n\tif(regions.noPostalCodeCountriesIds.some(id => id === countryId)) {\r\n\t\treturn true\r\n\t}\r\n\r\n\treturn false\r\n}\r\n\r\nexport const formatZipCode = (value: string, countryId: string) => {\r\n\r\n\r\n\tif(hasNoPostalcode(countryId)) return value\r\n\r\n\tif(hasZipcode(countryId)){\r\n\t\tconst clearValue = removeNonNumeric(value)\r\n\t\treturn clearValue.slice(0, 5)\r\n\t}\r\n\r\n\tif(countryId === regions.canadaId){\r\n\r\n\t\tconst spaceRegex = /\\s/g\r\n\t\tconst numberRegex = /\\d/i\r\n\t\tconst letterRegex = /[A-Za-z]/i\r\n\r\n\t\t//remove spaces and upperCase it\r\n\t\tvalue = value.replace(spaceRegex, '').toLocaleUpperCase()\r\n\r\n\t\tconst lastChar = value[value.length - 1]\r\n\r\n\t\t//value is not empty\r\n\t\tif(value.length){\r\n\t\t\t// if the character is not what is supposed to be...\r\n\t\t\tif( ( isOdd(value.length) && lastChar.match(numberRegex) ) || ( !isOdd(value.length) && lastChar.match(letterRegex) ) ){\r\n\t\t\t\t// ...remove ir from the string\r\n\t\t\t\tvalue = value.substring(0, value.length - 1)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn `${value.slice(0, 3)} ${value.slice(3, 6)}`.trim()\r\n\t}\r\n\r\n\treturn value\r\n}\r\n\r\nconst isOdd = (num: number) => num % 2","import * as billing from \"./billing\"\r\nimport * as giftCard from \"./giftcard\"\r\nimport * as pages from \"./pages\"\r\nimport * as regions from './regions'\r\nimport * as validationType from './validation'\r\nimport * as terms from './terms'\r\nimport * as reload from './reload'\r\nimport * as errorcodes from './errorcodes'\r\n\r\nimport { getClientId, getShowGdpr, getReloadSessionId } from '../utils'\r\n\r\nconst SERVER_URL = process.env.NODE_ENV === \"development\" ? \"https://dev-reload.buyatab.com/\" : \"/\";\r\n\r\n(process.env.NODE_ENV === \"development\" && console.info('Environment:', process.env.NODE_ENV) )\r\n\r\nexport const CLIENT_ID = getClientId();\r\nexport const SHOW_GDPR: boolean = getShowGdpr();\r\nexport const RELOAD_SESSION_ID = getReloadSessionId();\r\n\r\nexport const API = {\r\n GET_CONFIGURATION_URL: `${SERVER_URL}Configuration/${CLIENT_ID}?${reload.reloadSessionId}=${RELOAD_SESSION_ID}`,\r\n GET_PREVIEW_CONFIGURATION_URL: `${SERVER_URL}Configuration/GetPreview/${CLIENT_ID}/`,\r\n GET_REGIONS_URL: `${SERVER_URL}Configuration/GetRegions/${CLIENT_ID}/`,\r\n VERIFY_CARD_URL: `${SERVER_URL}Card/Verify?${reload.reloadSessionId}=${RELOAD_SESSION_ID}`,\r\n SUBMIT_ORDER_URL: `${SERVER_URL}Order/Submit?${reload.reloadSessionId}=${RELOAD_SESSION_ID}`, \r\n SUCCESS_RESPONSE: 'Success',\r\n RECAPTCHA_FAILED: 'RecaptchaFailed',\r\n CARD_VERIFICATION_FAILED: 'CardVerificationFailed',\r\n SVS_CARD_VERIFICATION_FAILED: 'SvsCardInformationRequestFailed',\r\n INVALID_OR_EXPIRED_SESSION_ID: 'ExpiredReloadSessionId',\r\n UNABLE_TO_FIND_MAPPED_RELOAD_SESSION_ID:'UnableToFindMappedReloadSessionId',\r\n INVALID_STOREFRONTCODE_MAPPING:'InvalidStorefrontCodeMapping',\r\n SUBMIT_ORDER_FAILED: 'SubmitOrderFailed',\r\n AUTHENTICATION_FAILED: 'AuthenticationFailed',\r\n NOT_A_RELOAD_STOREFRONT: 'NotAReloadStorefront',\r\n REQUEST_ATTEMPTS: 1,\r\n EMAIL_VALIDATION_URL: `${SERVER_URL}Validation/validateEmail`,\r\n NOTIFY_PURCHASE_FAILURE_URL: `${SERVER_URL}Order/LogAndNotifyPurchaseSessionError`,\r\n CREATE_CREDIT_CARD_SESSION: `${SERVER_URL}CreditCardSession/${CLIENT_ID}/session?${reload.reloadSessionId}=${RELOAD_SESSION_ID}`\r\n}\r\n\r\nexport const RISKIFIED_URL = 'https://beacon.riskified.com?shop=DOMAIN&sid=KEY'\r\nexport const SIGNIFYD_URL = 'https://cdn-scripts.signifyd.com/api/script-tag.js'\r\n\r\nexport {\r\n billing,\r\n giftCard,\r\n pages,\r\n regions,\r\n validationType,\r\n terms,\r\n reload,\r\n errorcodes\r\n}\r\n\r\nexport const INVALID_OPTION = \"000\"\r\n","export default (cssUrl: string) => {\r\n const link = document.createElement('link')\r\n link.setAttribute('rel', 'stylesheet')\r\n link.setAttribute('type', 'text/css')\r\n link.setAttribute('href', cssUrl)\r\n link.setAttribute('crossorigin', 'anonymous')\r\n link.setAttribute('referrerpolicy', 'origin')\r\n document.getElementsByTagName('head')[0].appendChild(link)\r\n}","export const SET_CURRENT_PAGE = \"SET_CURRENT_PAGE\"\r\nexport const SET_CONTRAST_MODE = \"SET_CONTRAST_MODE\"\r\nexport const SET_URL_REFRRER = 'SET_URL_REFERRER'\r\n\r\nexport const setCurrentPage = (page: string) => {\r\n return{\r\n type: SET_CURRENT_PAGE,\r\n payload: page\r\n }\r\n}\r\n\r\nexport const setUrlReferrer = (refrrerUrl: string) => {\r\n return{\r\n type: SET_URL_REFRRER,\r\n payload: refrrerUrl\r\n }\r\n}\r\n\r\nexport const setContrastMode = (active: boolean) => {\r\n return{\r\n type: SET_CONTRAST_MODE,\r\n payload: active\r\n }\r\n}\r\n","import fetch from 'cross-fetch'\r\nimport { API, pages } from '../constants'\r\nimport { refreshToken } from './configuration.actions'\r\nimport { setCurrentPage } from './settings.actions'\r\n\r\nexport const GET_REGIONS = \"GET_REGIONS\"\r\n\r\nexport const getRegions = (countryId: string, languageCode: string, attempts: number = API.REQUEST_ATTEMPTS) => {\r\n \r\n return (dispatch, getState) => {\r\n const state = getState()\r\n const requestHeaders = {\r\n method: 'GET',\r\n headers: {\r\n Authorization: `Bearer ${state.configuration.token}`\r\n }\r\n }\r\n \r\n fetch(`${API.GET_REGIONS_URL}${countryId}/${languageCode}`, requestHeaders)\r\n .then(async (res: any) => {\r\n if (res.status === 401) {\r\n throw new URIError(\"Authentication Error\")\r\n }\r\n return res.json()\r\n })\r\n .then(countryList => {\r\n if (countryList){\r\n dispatch({\r\n type: GET_REGIONS,\r\n payload: countryList\r\n })\r\n }\r\n })\r\n .catch((error) =>{\r\n if(attempts > 0){\r\n refreshToken(dispatch(getRegions(countryId, languageCode, attempts - 1)))\r\n }else{\r\n console.error(error) \r\n dispatch(setCurrentPage(pages.ERROR))\r\n }\r\n })\r\n } \r\n} ","import fetch from 'cross-fetch'\r\nimport {API, giftCard, pages } from '../constants'\r\nimport { refreshToken } from './configuration.actions'\r\nimport { setCurrentPage } from './settings.actions'\r\nexport const SET_GIFT_CARD_INFO = \"SET_GIFT_CARD_INFO\"\r\n\r\nexport const setGiftCardInfo = (giftCardInfo: {}) => {\r\n return {\r\n type: SET_GIFT_CARD_INFO,\r\n payload: giftCardInfo\r\n }\r\n}\r\n\r\nexport const verifyCard = (cardInfo : any, callback: () => void, errorCallback: (e: string) => void, attempts: number = API.REQUEST_ATTEMPTS) => {\r\n\r\n return (dispatch, getState) => {\r\n const state = getState()\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': `Bearer ${state.configuration.token}`\r\n },\r\n body: JSON.stringify(cardInfo)\r\n }\r\n\r\n fetch(API.VERIFY_CARD_URL, requestOptions)\r\n .then(res => {\r\n if (res.status === 401) {\r\n throw new URIError(\"Authentication Error\")\r\n }\r\n return res.json()\r\n })\r\n .then(cardInfo => {\r\n if(cardInfo.status === API.SUCCESS_RESPONSE && cardInfo.balance >= 0){\r\n dispatch(setGiftCardInfo({ [giftCard.cardBalance]: cardInfo.balance, [giftCard.cardNumber]: cardInfo.cardNumber }))\r\n callback()\r\n } else {\r\n errorCallback(cardInfo.status)\r\n }\r\n })\r\n .catch((error) =>{\r\n if(attempts > 0){\r\n refreshToken(dispatch(verifyCard(cardInfo, callback, errorCallback, attempts - 1)))\r\n }else{\r\n console.error(error)\r\n dispatch(setCurrentPage(pages.ERROR))\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport const submitOrder = (orderInfo: any, successCallback: () => void, errorCallback: (e: any) => void, attempts: number = API.REQUEST_ATTEMPTS) => {\r\n return (dispatch, getState) => {\r\n const state = getState()\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': `Bearer ${state.configuration.token}`\r\n },\r\n body: JSON.stringify(orderInfo)\r\n }\r\n\r\n fetch(API.SUBMIT_ORDER_URL, requestOptions)\r\n .then(res => {\r\n if (res.status === 401) {\r\n throw new URIError(\"Authentication Error\")\r\n }\r\n return res.json()\r\n })\r\n .then(order => {\r\n if(order.status === API.SUCCESS_RESPONSE){\r\n dispatch(setGiftCardInfo({[giftCard.orderNumber]: order.orderNumber}))\r\n successCallback()\r\n }else{\r\n errorCallback(order)\r\n }\r\n })\r\n .catch((error) =>{\r\n if(attempts > 0){\r\n refreshToken(dispatch(submitOrder(orderInfo, successCallback, errorCallback, attempts - 1)))\r\n }else{\r\n console.error(error)\r\n dispatch(setCurrentPage(pages.ERROR))\r\n }\r\n })\r\n }\r\n}\r\nexport const notifyUser = (notificationData: any, authetication: any) => {\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': authetication\r\n },\r\n body: JSON.stringify(notificationData)\r\n }\r\n fetch(API.NOTIFY_PURCHASE_FAILURE_URL, requestOptions)\r\n}\r\n","export const SET_LANGUAGE = \"SET_LANGUAGE\"\r\n\r\nexport const setLanguage = (languageContent: {}) => {\r\n \r\n return {\r\n type: SET_LANGUAGE,\r\n payload: languageContent\r\n }\r\n}","import { API } from \"../constants\"\r\n\r\nexport const SET_BILLING_INFO = \"SET_BILLING_INFO\"\r\nexport const SET_CREDIT_CARD_SESSION = 'SET_CREDIT_CARD_SESSION'\r\n\r\nexport const setBillingInfo = (billingInfo: {}) => {\r\n return {\r\n type: SET_BILLING_INFO,\r\n payload: billingInfo\r\n }\r\n}\r\n\r\nexport const setCreditCardSessionId = (cardSession: {}) => {\r\n return {\r\n type: SET_CREDIT_CARD_SESSION,\r\n payload: cardSession\r\n }\r\n}\r\n\r\nexport const createCreditCardSession = () => {\r\n return (dispatch, getState) => {\r\n const state = getState()\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': `Bearer ${state.configuration.token}`\r\n }\r\n }\r\n\r\n fetch(API.CREATE_CREDIT_CARD_SESSION, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(\"Create Credit Card Session Failed:\", res);\r\n return 'N/A';\r\n }\r\n \r\n return res.json();\r\n })\r\n .then(data => {\r\n dispatch(setCreditCardSessionId(data));\r\n })\r\n .catch(error => {\r\n console.error('Error occurred while creating the credit card session', error);\r\n })\r\n \r\n }\r\n}","import fetch from 'cross-fetch'\r\nimport { API, giftCard, CLIENT_ID, RISKIFIED_URL, SIGNIFYD_URL, billing, pages, SHOW_GDPR } from '../constants'\r\nimport setStyle from \"../components/Style\"\r\nimport { getRegions } from \"./regions.actions\"\r\nimport { setGiftCardInfo } from \"./giftcard.actions\"\r\nimport { setLanguage } from './language.actions'\r\nimport TagManager from 'react-gtm-module'\r\nimport { setBillingInfo } from './billing.actions'\r\nimport { setCurrentPage, setContrastMode } from './settings.actions'\r\nimport { getUrlParam } from '../utils'\r\n\r\nexport const GET_CONFIGURATION = \"GET_CONFIGURATION\"\r\nexport const SET_TOKEN = \"SET_TOKEN\"\r\n\r\nexport const getConfiguration = (callback: () => void, errorCallback: () => void) => {\r\n return (dispatch) => {\r\n if (CLIENT_ID === 0) {\r\n errorCallback()\r\n return\r\n }\r\n\r\n fetch(API.GET_CONFIGURATION_URL)\r\n .then(res => {\r\n return res.json()\r\n })\r\n .then(configuration => {\r\n if (typeof configuration.status === 'undefined' || configuration.status !== API.SUCCESS_RESPONSE) {\r\n errorCallback()\r\n return\r\n }\r\n\r\n dispatch({\r\n type: GET_CONFIGURATION,\r\n payload: configuration\r\n })\r\n\r\n loadCSS(configuration.externalLinks.accessibleStyleUrl, callback)\r\n loadCSS(configuration.externalLinks.styleUrl, callback)\r\n\r\n\r\n document.getElementsByTagName('html')[0].setAttribute('lang', configuration.language.languageCode)\r\n\r\n const languageContent = JSON.parse(configuration.language.languageContent)\r\n const { year, month } = configuration.serverDate\r\n const countryList = configuration.billingCountry.billingCountries\r\n const country = getCountryById(configuration.billingCountry.defaultCountry, countryList)\r\n const riskifiedInfo = configuration.riskifiedInfo\r\n const signifydBeaconKey = configuration.signifydBeaconKey\r\n const cookieBotProviderId = 2\r\n const zendeskLiveChatType = 2\r\n\r\n document.title = `${languageContent.page_title}${configuration.storefront.storefrontName}`\r\n dispatch(setLanguage(languageContent))\r\n dispatch(getRegions(configuration.billingCountry.defaultCountry, configuration.language.languageCode))\r\n dispatch(setGiftCardInfo({[giftCard.cardReloadAmount]: configuration.amount.defaultAmount}))\r\n dispatch(setBillingInfo({[billing.expirationDate]: { month, year }}))\r\n dispatch(setBillingInfo({[billing.country]: { id: country.id, name: country.name } }))\r\n\r\n if(configuration.storefront.showContrastToggle){\r\n const isAccessible = getUrlParam(\"accessible\", window.location.href);\r\n if(isAccessible === \"true\"){\r\n dispatch(setContrastMode(true))\r\n }\r\n }\r\n\r\n // add the Buyatab GTM Container\r\n addGTMContainer(configuration.buyatabGTMContainer.containerId)\r\n // if exists, add the Storefront GTM Container\r\n if (configuration.storefront.analyticsId){\r\n addGTMContainer(configuration.storefront.analyticsId)\r\n }\r\n\r\n if (SHOW_GDPR && typeof window['buyatabGdpr'] !== \"undefined\") {\r\n window['buyatabGdpr']({\r\n cookiePolicyProvider: configuration.cookiePolicyProvider,\r\n buyatabCookiePolicy: configuration.clientCookiePolicy,\r\n cookiebot: configuration.cookiebot\r\n });\r\n }\r\n\r\n if (typeof window['liveChat'] !== \"undefined\") {\r\n\r\n if (configuration.cookiePolicyProvider === cookieBotProviderId) {\r\n // Live chat will be initiated by cookie bot\r\n if (configuration.chatType === zendeskLiveChatType) {\r\n window['liveChatOptions'] = configuration.zendeskLiveChat\r\n } else {\r\n window['liveChatOptions'] = configuration.conectysLiveChat\r\n }\r\n } else {\r\n if (configuration.chatType === zendeskLiveChatType) {\r\n window['liveChat'](configuration.zendeskLiveChat)\r\n } else {\r\n window['liveChat'](configuration.conectysLiveChat)\r\n }\r\n }\r\n }\r\n\r\n addRiskifiedBeacon(riskifiedInfo.riskifiedBeaconKey, riskifiedInfo.riskifiedStoreDomain)\r\n addSignifydBeacon(signifydBeaconKey)\r\n })\r\n }\r\n}\r\n\r\nexport const getPreviewConfiguration = (luid, version, callback: () => void, errorCallback: () => void) => {\r\n return (dispatch) => {\r\n if (CLIENT_ID === 0) {\r\n errorCallback();\r\n return;\r\n }\r\n\r\n fetch(`${API.GET_PREVIEW_CONFIGURATION_URL}${luid}/${version}`)\r\n .then(res => {\r\n return res.json();\r\n })\r\n .then(configuration => {\r\n if (typeof configuration.status === 'undefined' || configuration.status !== API.SUCCESS_RESPONSE) {\r\n errorCallback();\r\n return;\r\n }\r\n\r\n dispatch({\r\n type: GET_CONFIGURATION,\r\n payload: configuration\r\n });\r\n\r\n loadCSS(configuration.externalLinks.styleUrl, callback);\r\n\r\n document.getElementsByTagName('html')[0].setAttribute('lang', configuration.language.languageCode);\r\n\r\n const languageContent = JSON.parse(configuration.language.languageContent);\r\n const { year, month } = configuration.serverDate;\r\n const countryList = configuration.billingCountry.billingCountries;\r\n const country = getCountryById(configuration.billingCountry.defaultCountry, countryList);\r\n\r\n document.title = `${languageContent.page_title}${configuration.storefront.storefrontName}`;\r\n dispatch(setLanguage(languageContent));\r\n dispatch(getRegions(configuration.billingCountry.defaultCountry, configuration.language.languageCode));\r\n dispatch(setGiftCardInfo({ [giftCard.cardReloadAmount]: configuration.amount.defaultAmount }));\r\n dispatch(setBillingInfo({ [billing.expirationDate]: { month, year } }));\r\n dispatch(setBillingInfo({ [billing.country]: { id: country.id, name: country.name } }));\r\n\r\n if (configuration.storefront.showContrastToggle) {\r\n const isAccessible = getUrlParam(\"accessible\", window.location.href);\r\n if (isAccessible === \"true\") {\r\n dispatch(setContrastMode(true));\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport const refreshToken = (callback: () => void) => {\r\n return (dispatch) => {\r\n\r\n if (CLIENT_ID === 0) {\r\n dispatch(setCurrentPage(pages.ERROR))\r\n return\r\n }\r\n\r\n fetch(API.GET_CONFIGURATION_URL)\r\n .then(res => {\r\n return res.json()\r\n })\r\n .then(configuration => {\r\n if (typeof configuration.status === 'undefined' || configuration.status !== API.SUCCESS_RESPONSE) {\r\n dispatch(setCurrentPage(pages.ERROR))\r\n return\r\n }\r\n\r\n dispatch({\r\n type: SET_TOKEN,\r\n payload: configuration.token\r\n })\r\n\r\n callback()\r\n })\r\n }\r\n}\r\n\r\n//Loading the css\r\nconst loadCSS = async (cssUrl: string, callback: () => void) => {\r\n try {\r\n setStyle(cssUrl)\r\n\r\n let requestOptions: RequestInit = {\r\n mode: \"cors\"\r\n }\r\n\r\n const res = await fetch(cssUrl, requestOptions)\r\n\r\n if (res.status >= 400) {\r\n throw new Error(\"Bad response from server\");\r\n }else{\r\n setTimeout(callback, 0)\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\n\r\n// initialize GTM\r\nconst addGTMContainer = (analyticsId: string) => {\r\n TagManager.initialize({gtmId: analyticsId})\r\n}\r\n\r\nexport const getCountryById = (id: string | number, countries: any) => {\r\n // eslint-disable-next-line eqeqeq\r\n return countries.find((country: any) => {return country.id == id})\r\n}\r\n\r\n//add the riskified beacon\r\nconst addRiskifiedBeacon = (beaconKey: string, storeDomain: string) => {\r\n const values = {\r\n DOMAIN: storeDomain,\r\n KEY: beaconKey\r\n }\r\n\r\n const url = RISKIFIED_URL.replace(/DOMAIN|KEY/gi, function(matched){\r\n return values[matched]\r\n })\r\n\r\n const s = document.createElement(\"script\")\r\n s.type = \"text/javascript\"\r\n s.async = true\r\n s.src = url\r\n const x = document.getElementsByTagName(\"script\")[0]\r\n x.parentNode?.insertBefore(s, x)\r\n\r\n}\r\n\r\n//add the signifyd beacon\r\nconst addSignifydBeacon = (sessionId: string) => {\r\n\r\n const url = SIGNIFYD_URL\r\n\r\n const s = document.createElement(\"script\")\r\n s.type = \"text/javascript\"\r\n s.src = url;\r\n s.id = \"sig-api\";\r\n s.setAttribute(\"data-order-session-id\", sessionId);\r\n s.setAttribute(\"defer\", \"defer\");\r\n const x = document.getElementsByTagName(\"script\")[0]\r\n x.parentNode?.insertBefore(s, x)\r\n\r\n}","import React from 'react'\r\n\r\nexport default () => {\r\n return (\r\n
\r\n
\r\n \r\n \r\n \"Buyatab\r\n \r\n \r\n

Our apologies, this gift card application is no longer available for this store front. Please contact support for assistance: 1-888-267-0447.

\r\n

Nous sommes désolés, cette carte cadeau n’est plus disponible pour ce magasin. Veuillez contacter le soutien à la clientèle au 1-888-267-0447.

\r\n
\r\n
\r\n )\r\n}","import React from 'react'\r\n\r\ninterface IField {\r\n id: string,\r\n type?: string,\r\n pattern?: string,\r\n classes?: string,\r\n label: string,\r\n placeholder?: string,\r\n detail: any,\r\n required?: boolean,\r\n value?: string,\r\n validationError?: any,\r\n autoComplete?: string,\r\n renderKey?: string,\r\n isDisabled?: boolean,\r\n handleChange?: (event: React.ChangeEvent) => void,\r\n validation?: (ref: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null) => void \r\n}\r\n\r\nconst Field = (field: IField) => {\r\n const isInvalid = typeof field.validationError !== 'undefined'\r\n const errorMessage = field.validationError? field.validationError.message : ''\r\n return(\r\n
\r\n
\r\n
\r\n \r\n
\r\n
{errorMessage}
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
{field.detail}
\r\n
\r\n
\r\n )\r\n}\r\n\r\nField.defaultProps = {\r\n type: \"text\",\r\n detail: \"\",\r\n required: false,\r\n value: \"\",\r\n}\r\n\r\n\r\nexport default React.memo(Field)","import React from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\n\r\ninterface IContactUs {}\r\n\r\nconst ContactUsSection = (props: IContactUs) => {\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const language = useSelector((state: any) => state.language);\r\n let { contactNumber, supportEmail } = configuration.storefront;\r\n\r\n return (\r\n

\r\n \r\n {!configuration.hasCustomFooter ? (\r\n \r\n {contactNumber} | {supportEmail}\r\n \r\n ) : null}\r\n

\r\n );\r\n};\r\n\r\nContactUsSection.defaultProps = {};\r\n\r\nexport default ContactUsSection;\r\n","import React, { useRef, useEffect } from \"react\";\r\nimport { NestDataObject } from \"react-hook-form\";\r\nimport { isEmpty } from \"../utils\";\r\nimport uniqid from \"uniqid\";\r\nimport ContactUsSection from \"./ContactUsSection\";\r\n\r\ninterface IPageNavigation {\r\n label?: any;\r\n errors?: NestDataObject>;\r\n displayErrors?: boolean;\r\n title?: string;\r\n buttons: React.ReactNode;\r\n}\r\n\r\nconst handleKeyPress = (event) => {\r\n //enter or space\r\n if (event.keyCode === 13 || event.keyCode === 32) {\r\n event.target.click();\r\n }\r\n};\r\n\r\nconst errorsList = (errors) => {\r\n return Object.keys(errors).map((id) => {\r\n const message = errors[id].message;\r\n let label = errors[id].ref.labels ? errors[id].ref.labels[0].innerText : getLabel(errors[id].ref.id);\r\n\r\n if (errors[id].ref.type === \"checkbox\") {\r\n label = \"Error\";\r\n }\r\n\r\n return (\r\n
  • \r\n \r\n {`${label} - ${message}`}\r\n \r\n
  • \r\n );\r\n });\r\n};\r\n\r\nconst getLabel = (id: string) => {\r\n return document.querySelector(\"label[for=\" + id + \"]\")?.innerHTML\r\n ? document.querySelector(\"label[for=\" + id + \"]\")?.innerHTML\r\n : \"Error\";\r\n};\r\n\r\nexport default (props: IPageNavigation) => {\r\n const { displayErrors = false } = props;\r\n const errorRef = useRef(null);\r\n\r\n useEffect(() => {\r\n props.errors && displayErrors && !isEmpty(props.errors) && errorRef.current && errorRef.current.focus();\r\n }, [displayErrors, props.errors]);\r\n\r\n return (\r\n
    \r\n {props.errors && displayErrors && !isEmpty(props.errors) && (\r\n \r\n \r\n {props.title}\r\n \r\n
      {errorsList(props.errors)}
    \r\n \r\n
    \r\n )}\r\n {props.buttons}\r\n \r\n );\r\n};\r\n","import React from 'react'\r\nimport ReCAPTCHA from \"react-google-recaptcha\"\r\n\r\ninterface IRecaptchaField {\r\n id: string,\r\n label: string, \r\n siteKey: string,\r\n languageCode: string,\r\n recaptchaRef:any,\r\n onChange: (token : string | null) => void,\r\n}\r\n\r\nconst RecaptchaField = (props: IRecaptchaField) => {\r\n\r\n return(\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n )\r\n}\r\n\r\nexport default RecaptchaField","import React from 'react'\r\n\r\nexport interface IButton {\r\n id?: any,\r\n isPrimary?: boolean,\r\n isLeft?: boolean,\r\n label: any,\r\n isDisabled?: boolean,\r\n handleOnClick: () => void,\r\n testRole? : string\r\n}\r\n\r\nexport default (button: IButton) => {\r\n\r\n const { id, isPrimary = false, isLeft = false, label, handleOnClick, isDisabled = false, testRole = null } = button;\r\n\r\n return (\r\n \r\n )\r\n}","import React, { useState, useCallback, useEffect, useRef } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { useForm } from \"react-hook-form\";\r\nimport Field from \"../../components/Field\";\r\nimport PageNavigation from \"../../components/PageNavigation\";\r\nimport { setGiftCardInfo, setCurrentPage, verifyCard ,setUrlReferrer} from \"../../actions\";\r\nimport { formatNumbers, isEmpty, isNonEmptyString } from \"../../utils\";\r\nimport RecaptchaField from \"../../components/RecaptchaField\";\r\nimport Button from \"../../components/Button\";\r\nimport { giftCard, pages, validationType, CLIENT_ID, API } from \"../../constants\";\r\nimport { HalfCircleSpinner } from \"react-epic-spinners\";\r\n\r\n\r\nexport default () => {\r\n const dispatch = useDispatch();\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const language = useSelector((state: any) => state.language);\r\n const giftCardInfo = useSelector((state: any) => state.giftCard);\r\n const { register, errors, triggerValidation, setError, clearError } = useForm({\r\n mode: \"onBlur\",\r\n submitFocusError: false,\r\n });\r\n const { showPin, isPinRequired } = configuration.storefront;\r\n const { languageCode } = configuration.language;\r\n const { validation } = language.errors;\r\n const [disableButton, setDisableButton] = useState(false);\r\n const [isRecaptchaValid, setIsRecaptchaValid] = useState(false);\r\n const [recaptchaToken, setRecaptchaToken] = useState(\"\");\r\n const [isPageValid, setIsPageValid] = useState(false);\r\n const [displayErrors, setDisplayErrors] = useState(false);\r\n const recaptchaRef = React.createRef();\r\n const [callingApi, setCallingApi] = useState(false);\r\n const componentIsMounted = useRef(true);\r\n const { showContrastToggle } = configuration.storefront || false;\r\n const reloadCardSession = configuration.reloadCardSession;\r\n\r\n useEffect(() => {\r\n return () => {\r\n //track if component is mounted\r\n componentIsMounted.current = false;\r\n };\r\n }, []);\r\n\r\n const callVerifyCard = () => {\r\n if (isPageValid && isRecaptchaValid && recaptchaRef.current !== null) {\r\n const cardInfo = {\r\n cardInformation: {\r\n cardNumber: giftCardInfo[giftCard.cardNumber].replace(/\\s/g, \"\"),\r\n cardPin: giftCardInfo[giftCard.cardPin].replace(/\\s/g, \"\"),\r\n\r\n },\r\n recaptchaResponse: giftCardInfo[giftCard.recaptchaResponse],\r\n storeFrontCode: CLIENT_ID,\r\n };\r\n\r\n if (!callingApi) {\r\n setCallingApi(true);\r\n dispatch(\r\n verifyCard(\r\n cardInfo,\r\n () => {\r\n setCallingApi(false);\r\n // move to the next page\r\n dispatch(setCurrentPage(pages.AMOUNT_SELECTION));\r\n },\r\n (status: string) => {\r\n if (componentIsMounted.current) {\r\n clearError();\r\n setCallingApi(false);\r\n switch (status) {\r\n case API.RECAPTCHA_FAILED:\r\n setError(giftCard.recaptchaResponse, API.RECAPTCHA_FAILED, validation.recaptcha_error);\r\n setDisplayErrors(true);\r\n break;\r\n case API.CARD_VERIFICATION_FAILED:\r\n setError(giftCard.cardNumber, API.CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n case API.SVS_CARD_VERIFICATION_FAILED:\r\n setError(giftCard.cardNumber, API.SVS_CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n case API.INVALID_OR_EXPIRED_SESSION_ID:\r\n setError(giftCard.cardNumber, API.SVS_CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n case API.NOT_A_RELOAD_STOREFRONT:\r\n setError(giftCard.cardNumber, API.SVS_CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n case API.INVALID_STOREFRONTCODE_MAPPING:\r\n setError(giftCard.cardNumber, API.SVS_CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n case API.UNABLE_TO_FIND_MAPPED_RELOAD_SESSION_ID:\r\n setError(giftCard.cardNumber, API.SVS_CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n default:\r\n setError(giftCard.cardNumber, API.CARD_VERIFICATION_FAILED, validation.card_verification_failed);\r\n setDisplayErrors(true);\r\n break;\r\n }\r\n // enable the button\r\n setDisableButton(false);\r\n }\r\n }\r\n )\r\n );\r\n }\r\n }\r\n };\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n event.target.value = formatNumbers(event.target.value);\r\n dispatch(setGiftCardInfo({ [event.target.id]: event.target.value }));\r\n //set page validation to false to be reavaluated\r\n setIsPageValid(false);\r\n },\r\n [dispatch]\r\n );\r\n\r\n const recaptchaVerifyCallback = (token: string | null) => {\r\n if (token) {\r\n dispatch(setGiftCardInfo({ [giftCard.recaptchaResponse]: token }));\r\n setIsRecaptchaValid(true);\r\n }\r\n };\r\n\r\n const checkValidation = async () => {\r\n if (!disableButton) {\r\n setDisableButton(true);\r\n\r\n if (recaptchaRef.current) {\r\n recaptchaRef.current.reset();\r\n recaptchaRef.current.execute();\r\n } else {\r\n setError(giftCard.recaptchaResponse, API.RECAPTCHA_FAILED, validation.recaptcha_error);\r\n }\r\n\r\n await triggerValidation([giftCard.cardNumber, showPin && isPinRequired ? giftCard.cardPin : \"\"]);\r\n\r\n if (isEmpty(errors)) {\r\n setIsPageValid(true);\r\n setDisplayErrors(false);\r\n } else {\r\n setDisplayErrors(true);\r\n setDisableButton(false);\r\n }\r\n }\r\n };\r\n\r\n const captureUrlReferrer = () => {\r\n if(reloadCardSession){\r\n dispatch(setUrlReferrer(document.referrer))\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n captureUrlReferrer();\r\n },[]);\r\n\r\n useEffect(() => {\r\n \r\n // if recaptcha and form are valid...\r\n if (\r\n isRecaptchaValid &&\r\n isPageValid &&\r\n recaptchaRef.current !== null &&\r\n recaptchaToken !== recaptchaRef.current.getValue()\r\n ) {\r\n setRecaptchaToken(recaptchaRef.current.getValue());\r\n callVerifyCard();\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [isPageValid, isRecaptchaValid, recaptchaRef]);\r\n\r\n const {\r\n gift_card_info: { page_title, gift_card },\r\n } = language;\r\n const { number, pin, recaptcha } = gift_card.fields;\r\n const maskedCardNumber = reloadCardSession?.maskedCardNumber;\r\n const hasMaskedCardNumber = isNonEmptyString(maskedCardNumber);\r\n\r\n return ( \r\n \r\n {showContrastToggle &&

    {page_title}

    }\r\n\r\n \r\n {showContrastToggle &&

    {gift_card.section_title}

    }\r\n\r\n
    \r\n {gift_card.legend_description}\r\n {showContrastToggle && (\r\n \r\n {language.form_message}\r\n

    \r\n )}\r\n {!hasMaskedCardNumber && ()}\r\n\r\n {hasMaskedCardNumber && \r\n }\r\n {showPin && (\r\n \r\n )}\r\n\r\n \r\n
    \r\n \r\n\r\n \r\n \r\n ) : (\r\n language.page_navigation.next_button_label\r\n )\r\n }\r\n isDisabled={disableButton}\r\n handleOnClick={() => {\r\n checkValidation();\r\n }}\r\n testRole='primary-button'\r\n />\r\n \r\n }\r\n />\r\n \r\n );\r\n};\r\n","import React, { useState, useEffect } from 'react'\r\nimport { addLeadingZero } from \"../utils\"\r\nimport uniqid from \"uniqid\"\r\nimport { rangeArray } from '../utils'\r\n\r\ninterface IExpirationDateField {\r\n id: string,\r\n label: string,\r\n detail?: string,\r\n thisYear: number,\r\n thisMonth: number,\r\n year: number,\r\n month: number,\r\n expirationDateRef: React.RefObject,\r\n handleChange: (event: React.ChangeEvent) => void,\r\n}\r\n\r\nconst yearsOptions = (startingYear: number) => {\r\n const years = rangeArray(startingYear, startingYear + 10)\r\n\r\n return years.map((thisYear: number) => {\r\n return \r\n }) \r\n}\r\n\r\nconst monthsOptions = (startingMonth: number = 1) => {\r\n const months = rangeArray(startingMonth, 13)\r\n\r\n return months.map((thisMonth:number) => {\r\n return \r\n })\r\n}\r\n\r\nconst ExpirationDateField = (props: IExpirationDateField) => {\r\n const [months, setMonths] = useState(monthsOptions(props.thisMonth))\r\n\r\n useEffect(() => {\r\n // eslint-disable-next-line eqeqeq\r\n if(props.year === 0 || props.year == props.thisYear){\r\n setMonths(monthsOptions(props.thisMonth))\r\n }else{\r\n setMonths(monthsOptions(1))\r\n }\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [props.month, props.year])\r\n\r\n return (\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    {props.detail}
    \r\n
    \r\n
    \r\n )\r\n}\r\n\r\nexport default React.memo(ExpirationDateField)","import React, { useEffect } from 'react'\r\nimport Payment from \"payment\"\r\n\r\nexport default (props:{creditCardNumber:string, setIssuer: (issuer: string) => void}) => {\r\n const issuer = Payment.fns.cardType(props.creditCardNumber)\r\n\r\n useEffect(() => {\r\n props.setIssuer(issuer)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [issuer])\r\n\r\n return (\r\n
      \r\n
    • \r\n
    • \r\n
    • \r\n
    \r\n )\r\n}","import { useCallback, useState, useEffect } from \"react\"\r\n\r\nconst useRoveFocus = (size: number) => {\r\n const [currentFocus, setCurrentFocus] = useState(0)\r\n\r\n const handleKeyDown = useCallback(\r\n event => {\r\n\r\n if (event.keyCode === 39) {\r\n // ArrowRight\r\n event.preventDefault()\r\n setCurrentFocus(currentFocus === size - 1 ? currentFocus : currentFocus + 1)\r\n } else if (event.keyCode === 37) {\r\n // ArrowLeft\r\n event.preventDefault()\r\n setCurrentFocus(currentFocus === 0 ? currentFocus : currentFocus - 1)\r\n } else if (event.keyCode === 36) {\r\n // Home (fnc + home)\r\n event.preventDefault()\r\n setCurrentFocus(0)\r\n } else if (event.keyCode === 35) {\r\n // End (fnc + end)\r\n event.preventDefault()\r\n setCurrentFocus(size - 1)\r\n }\r\n },\r\n\r\n [size, currentFocus, setCurrentFocus]\r\n )\r\n\r\n useEffect(() => {\r\n document.addEventListener(\"keydown\", handleKeyDown, false)\r\n return () => {\r\n document.removeEventListener(\"keydown\", handleKeyDown, false)\r\n }\r\n }, [handleKeyDown])\r\n\r\n return [currentFocus, setCurrentFocus]\r\n}\r\n\r\nexport default useRoveFocus","import { useSelector } from \"react-redux\"\r\nimport { validationType } from '../constants'\r\nimport Payment from 'payment'\r\nimport { useCallback } from \"react\"\r\n\r\nexport const useRegexValidation = (validationType: string) => {\r\n const configuration = useSelector((state: any) => state.configuration)\r\n const { validation } = configuration\r\n const language = useSelector((state: any) => state.language)\r\n \r\n const vType = validation.filter((v) => v.name === validationType )[0]\r\n const expression = new RegExp(vType.regex)\r\n\r\n const functionCreator = useCallback(\r\n () => {\r\n return {[validationType]: (value: string) => { \r\n if(!expression.test(value)) { \r\n return language.errors.validation[vType.name] \r\n } \r\n }\r\n } \r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [validationType] )\r\n\r\n return functionCreator()\r\n}\r\n\r\n// returns an object required for the validate type\r\nexport const useMultipleRegexValidation = (checkValidationTypes: string[]) => {\r\n const configuration = useSelector((state: any) => state.configuration)\r\n const { validation } = configuration\r\n const language = useSelector((state: any) => state.language)\r\n\r\n //map the field's validation types to the validation object\r\n let validationTypes = validation.filter((thisValidation: Record) => {\r\n return checkValidationTypes.filter(function(name) { return name === thisValidation.name }).length > 0\r\n })\r\n\r\n const callFunctions = useCallback (() => { \r\n let functions = {}\r\n \r\n for (let vType of validationTypes) {\r\n const expression = new RegExp(vType.regex)\r\n \r\n functions = {...functions, ...{ [vType.name]: \r\n (value: string) => { \r\n if(!expression.test(value)) { \r\n return language.errors.validation[vType.name] \r\n } \r\n }\r\n }\r\n }\r\n }\r\n \r\n return functions\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [ validationTypes])\r\n\r\n return callFunctions()\r\n}\r\n\r\nexport const useCreditCardValidation = () => {\r\n const language = useSelector((state: any) => state.language)\r\n \r\n return {...{[validationType.creditcard]: (value: string) => {\r\n if( !Payment.fns.validateCardNumber(value.replace(/\\s/g, '')) ){\r\n return language.errors.validation[validationType.creditcard]\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import React from 'react'\r\n\r\ninterface IFieldPaysafe {\r\n id: string,\r\n classes?: string,\r\n label: string,\r\n placeholder?: string,\r\n detail: any\r\n}\r\n\r\nconst FieldPaysafe = (field: IFieldPaysafe) => {\r\n\r\n return(\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n
    {field.detail}
    \r\n
    \r\n
    \r\n )\r\n}\r\n\r\nFieldPaysafe.defaultProps = {\r\n type: \"text\",\r\n detail: \"\"\r\n}\r\n\r\n\r\nexport default React.memo(FieldPaysafe)\r\n","import React, { useCallback, useRef } from 'react'\r\nimport ExpirationDateField from '../../components/ExpirationDateField'\r\nimport Field from '../../components/Field'\r\nimport CreditCardIssuer from \"../../components/CreditCardIssuer\"\r\nimport { setBillingInfo } from \"../../actions\"\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { formatCreditCardNumber, formatCVC } from \"../../utils\"\r\nimport { billing, validationType } from \"../../constants\"\r\nimport { useCreditCardValidation } from '../../hooks'\r\nimport FieldPaysafe from '../../components/FieldPaysafe'\r\n\r\nexport default (props) => {\r\n const dispatch = useDispatch()\r\n const billingInfo = useSelector((state: any) => state.billing)\r\n const configuration = useSelector((state: any) => state.configuration)\r\n const language = useSelector((state: any) => state.language)\r\n const { year, month } = configuration.serverDate\r\n const { cvdUrl } = configuration.externalLinks\r\n const { credit_card } = language.payment_info\r\n const { number, name, expiration_date, cvd } = credit_card.fields\r\n const expirationDateRef = useRef(null)\r\n const { validation } = language.errors\r\n const { showContrastToggle } = configuration.storefront || false\r\n const { isTokenPayment } = configuration.paymentConfiguration || false\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n if (event.target.id === billing.number) {\r\n event.target.value = formatCreditCardNumber(event.target.value)\r\n }\r\n\r\n if (event.target.id === billing.cvd) {\r\n event.target.value = formatCVC(event.target.value)\r\n }\r\n\r\n dispatch(setBillingInfo({ [event.target.id]: event.target.value }))\r\n\r\n }, [dispatch])\r\n\r\n const handleIssuer = (issuer: string) => {\r\n dispatch(setBillingInfo({ [billing.issuer]: issuer }))\r\n localStorage.setItem(\"CcIssuer\", issuer)\r\n }\r\n\r\n const handleExpirationDateChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n let selectedMonth = billingInfo[billing.expirationDate].month\r\n let selectedYear = billingInfo[billing.expirationDate].year\r\n\r\n if (expirationDateRef.current?.id === event.target.id) {\r\n selectedMonth = parseInt(event.target.value)\r\n } else {\r\n selectedYear = parseInt(event.target.value)\r\n }\r\n\r\n // ensure date is not past\r\n if (selectedYear === year && selectedMonth < month) {\r\n selectedMonth = month\r\n }\r\n\r\n dispatch(setBillingInfo({ [billing.expirationDate]: { month: selectedMonth, year: selectedYear } }))\r\n\r\n }, [billingInfo, dispatch, month, year]\r\n\r\n )\r\n\r\n return (\r\n
    \r\n {showContrastToggle &&

    {credit_card.section_title}

    }\r\n\r\n
    \r\n {credit_card.legend_description}\r\n {showContrastToggle &&

    {language.form_message}

    }\r\n\r\n \r\n\r\n {isTokenPayment ?\r\n\r\n \r\n :\r\n \r\n }\r\n\r\n \r\n\r\n {isTokenPayment ?\r\n\r\n \r\n :\r\n \r\n }\r\n\r\n {isTokenPayment ?\r\n\r\n \r\n {cvd.detail}\r\n \r\n }\r\n />\r\n :\r\n \r\n {cvd.detail}\r\n \r\n }\r\n required={true}\r\n value={billingInfo[billing.cvd]}\r\n handleChange={handleFieldChange}\r\n validationError={props.validationForm.errors[billing.cvd]}\r\n validation={props.validationForm.register({ required: validation[validationType.required] })}\r\n />\r\n }\r\n\r\n
    \r\n
    \r\n )\r\n}\r\n","import React, { useState, useEffect } from 'react'\r\nimport uniqid from \"uniqid\"\r\n \r\nexport interface ISelectField {\r\n id: string,\r\n classes?: string,\r\n label: string,\r\n detail: any,\r\n required?: boolean,\r\n value?: string,\r\n options: [{id: string, name: string}],\r\n validationError?: any,\r\n handleChange?: (event: React.ChangeEvent) => void,\r\n validation?: (ref: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null) => void \r\n}\r\n\r\nconst SelectField = (props: ISelectField) => {\r\n const isInvalid = typeof props.validationError !== 'undefined'\r\n const errorMessage = props.validationError? props.validationError.message : ''\r\n const [options, setOptions] = useState()\r\n\r\n useEffect(() => {\r\n setOptions(props.options.map((option)=>{ \r\n return \r\n }))\r\n }, [props.options]);\r\n\r\n return( \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    {errorMessage}
    \r\n
    \r\n\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    {props.detail}
    \r\n
    \r\n
    \r\n )\r\n}\r\n\r\nexport default React.memo(SelectField)","import React, { useState, useEffect } from 'react'\r\nimport uniqid from \"uniqid\"\r\nimport { INVALID_OPTION } from '../constants'\r\n\r\nexport interface IRegions {\r\n id: string,\r\n classes?: string,\r\n label: string,\r\n detail: any,\r\n required?: boolean,\r\n value: {id:string, name:string}, \r\n validationError?: any,\r\n renderKey?: string,\r\n options: [{id: string, name: string}],\r\n defaultOptionLabel?: string,\r\n handleChange: (event: React.ChangeEvent) => void,\r\n validation?: (ref: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null) => void \r\n}\r\n\r\nconst RegionsField = (props: IRegions) => { \r\n const isInvalid = typeof props.validationError !== 'undefined'\r\n const errorMessage = props.validationError ? props.validationError.message : '' \r\n const [options, setOptions] = useState()\r\n\r\n useEffect(() => {\r\n if(props.options.length){\r\n let theOptions = props.options.map((option)=>{ \r\n return \r\n })\r\n\r\n if(props.defaultOptionLabel){\r\n theOptions.unshift()\r\n }\r\n \r\n setOptions(theOptions)\r\n }\r\n\r\n }, [props.defaultOptionLabel, props.options]);\r\n\r\n return( \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    {errorMessage}
    \r\n
    \r\n\r\n
    \r\n
    \r\n {(props.options.length > 0) ?\r\n (\r\n
    \r\n \r\n
    \r\n ) : \r\n ()\r\n }\r\n
    \r\n
    {props.detail}
    \r\n
    \r\n
    \r\n )\r\n}\r\n\r\nexport default React.memo(RegionsField)","import React, { useState, useEffect, useCallback } from \"react\";\r\nimport Field from \"../../components/Field\";\r\nimport SelectField from \"../../components/SelectField\";\r\nimport RegionsField from \"../../components/RegionsField\";\r\nimport { setBillingInfo, getRegions, getCountryById } from \"../../actions\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { formatCreditCardNumber, getRegionLabel, getZipLabel, getZipValidationType, formatZipCode } from \"../../utils\";\r\nimport { billing, validationType, INVALID_OPTION } from \"../../constants\";\r\n\r\nexport default (props) => {\r\n const dispatch = useDispatch();\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const regions = useSelector((state: any) => state.regions);\r\n const language = useSelector((state: any) => state.language);\r\n const { defaultCountry, billingCountries } = configuration.billingCountry;\r\n const { languageCode } = configuration.language;\r\n const { billing_info } = language.payment_info;\r\n const { validation } = language.errors;\r\n const { address, address2, city, country, region, zip_postal } = billing_info.fields;\r\n const { validationRules } = configuration;\r\n const [zipcodePattern, setZipcodePattern] = useState(new RegExp(\"\"));\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n if (event) {\r\n if (event.target.id === billing.number) {\r\n event.target.value = formatCreditCardNumber(event.target.value);\r\n }\r\n\r\n if (event.target.id === billing.zipCode) {\r\n event.target.value =\r\n formatZipCode(event.target.value, billingInfo[billing.country].id || defaultCountry) || \"\";\r\n }\r\n\r\n dispatch(setBillingInfo({ [event.target.id]: event.target.value }));\r\n }\r\n },\r\n [billingInfo, defaultCountry, dispatch]\r\n );\r\n\r\n //useCallback here seems to resolve the performance issue\r\n const handleSelectChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n const { id, value } = event.target;\r\n\r\n if (id === billing.country) {\r\n const name = getCountryById(value, configuration.billingCountry.billingCountries).name;\r\n\r\n dispatch(setBillingInfo({ [billing.country]: { id: value, name } }));\r\n\r\n //reset region and zipcode\r\n dispatch(setBillingInfo({ [billing.region]: { id: -1, name: \"\" } }));\r\n dispatch(setBillingInfo({ [billing.zipCode]: \"\" }));\r\n props.validationForm.clearError(billing.zipCode);\r\n props.validationForm.clearError(billing.region);\r\n dispatch(getRegions(value, languageCode));\r\n }\r\n },\r\n [configuration.billingCountry.billingCountries, dispatch, languageCode, props.validationForm]\r\n );\r\n\r\n const handleRegionsChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n let id: string, name: string;\r\n if (event.target.tagName === \"SELECT\") {\r\n const index = (event.nativeEvent.target! as HTMLSelectElement).selectedIndex;\r\n\r\n name = event.nativeEvent.target![index].text;\r\n id = event.target.value;\r\n } else {\r\n name = event.target.value;\r\n id = \"-1\";\r\n }\r\n\r\n dispatch(setBillingInfo({ [billing.region]: { id, name } }));\r\n },\r\n [dispatch]\r\n );\r\n\r\n useEffect(() => {\r\n if (validationRules[getZipValidationType(billingInfo[billing.country].id)]) {\r\n const expression = new RegExp(validationRules[getZipValidationType(billingInfo[billing.country].id)]);\r\n\r\n setZipcodePattern(expression);\r\n } else {\r\n setZipcodePattern(new RegExp(\"\"));\r\n }\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [billingInfo[billing.country], validationRules]);\r\n\r\n return (\r\n \r\n

    {billing_info.section_title}

    \r\n
    \r\n {billing_info.legend_description}\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n {\r\n if (value === INVALID_OPTION) {\r\n return region.detail + getRegionLabel(billingInfo[billing.country].id || defaultCountry, region);\r\n }\r\n },\r\n },\r\n })}\r\n defaultOptionLabel={region.detail + getRegionLabel(billingInfo[billing.country].id || defaultCountry, region)}\r\n />\r\n\r\n \r\n
    \r\n \r\n );\r\n};\r\n","import React, { useCallback } from 'react'\r\nimport Field from '../../components/Field'\r\nimport { setBillingInfo } from \"../../actions\"\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { formatCreditCardNumber, getClientId } from \"../../utils\"\r\nimport { API, billing, validationType } from \"../../constants\"\r\n\r\nexport const CLIENT_ID = getClientId();\r\n\r\nexport default (props) => {\r\n const dispatch = useDispatch()\r\n const billingInfo = useSelector((state: any) => state.billing)\r\n const configuration = useSelector((state: any) => state.configuration)\r\n const language = useSelector((state: any) => state.language)\r\n const { purchaser } = language.payment_info\r\n const { phone_number, email } = purchaser.fields\r\n const { validation } = language.errors\r\n const { validationRules } = configuration\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n if (event){\r\n\r\n if(event.target.id === billing.number) {\r\n event.target.value = formatCreditCardNumber(event.target.value)\r\n }\r\n\r\n dispatch(setBillingInfo({[event.target.id]: event.target.value}))\r\n }\r\n }, [dispatch])\r\n\r\n\r\n const validateEmail = async (email: any) => {\r\n\r\n const emailInfo = {\r\n emailAddress: email,\r\n storeFrontCode: CLIENT_ID,\r\n }\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': `Bearer ${configuration.token}`\r\n },\r\n body: JSON.stringify(emailInfo)\r\n }\r\n const response = await fetch(API.EMAIL_VALIDATION_URL, requestOptions)\r\n return await response.json()\r\n }\r\n\r\n return (\r\n
    \r\n

    {purchaser.section_title}

    \r\n
    \r\n {purchaser.legend_description}\r\n\r\n \r\n\r\n {\r\n const data = await validateEmail(value);\r\n return data.isValid === true || validation[validationType.email];\r\n }\r\n },\r\n\r\n })}\r\n />\r\n\r\n
    \r\n
    \r\n )\r\n}","import React, { useMemo, useState, useEffect } from \"react\";\r\nimport CreditCardInformation from \"./CreditCardInformation\";\r\nimport BillingInformation from \"./BillingInformation\";\r\nimport PurchaserInformation from \"./PurchaserInformation\";\r\nimport PageNavigation from \"../../components/PageNavigation\";\r\nimport Button from \"../../components/Button\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { getRegions, setCurrentPage, setBillingInfo } from \"../../actions\";\r\nimport { pages, billing, giftCard, CLIENT_ID, errorcodes } from \"../../constants\";\r\nimport { useForm } from \"react-hook-form\";\r\nimport { isEmpty, removeNonNumeric, isNonEmptyString } from \"../../utils\";\r\nimport { notifyUser } from \"../../actions/giftcard.actions\";\r\n\r\nexport default () => {\r\n const dispatch = useDispatch();\r\n const language = useSelector((state: any) => state.language);\r\n const country = useSelector((state: any) => state.billing[billing.country]);\r\n const { register, errors, triggerValidation, clearError } = useForm({ mode: \"onBlur\" });\r\n const [isPageValid, setIsPageValid] = useState(false);\r\n const [disableButton, setDisableButton] = useState(false);\r\n const [displayErrors, setDisplayErrors] = useState(false);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const { showContrastToggle } = configuration.storefront || false;\r\n const { languageCode } = configuration.language;\r\n const { isTokenPayment } = configuration.paymentConfiguration || false;\r\n const [paysafeSingleUseToken, setPaysafeSingleUseToken] = useState(\"\");\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const giftCardInfo = useSelector((state: any) => state.giftCard);\r\n const [callPaysafe, setCallPaysafe] = useState(false);\r\n const [didCallPaysafe, setDidCallPaysafe] = useState(false);\r\n const [isPaymentGateWayEnabled, setIsPaymentGateWayEnabled] = useState(false);\r\n const [callPaymentGateway, setCallPaymentGateway] = useState(false);\r\n const { accessibleToggle } = useSelector((state: any) => state.settings);\r\n\r\n const validationForm = useMemo(() => {\r\n return { register, errors, clearError };\r\n }, [errors, register, clearError]);\r\n\r\n useEffect(() => {\r\n if (\r\n configuration.paymentConfiguration.paymentGateway &&\r\n configuration.paymentConfiguration.paymentGateway.isEnabled\r\n ) {\r\n setIsPaymentGateWayEnabled(true);\r\n setCallPaymentGateway(true);\r\n } else if (\r\n (!configuration.paymentConfiguration.paymentGateway ||\r\n !configuration.paymentConfiguration.paymentGateway.isEnabled) &&\r\n !callPaysafe\r\n ) {\r\n setCallPaysafe(true);\r\n }\r\n\r\n if (callPaysafe && !didCallPaysafe) {\r\n if (configuration.paymentConfiguration.isTokenPayment) {\r\n window[\"startPaysafe\"](configuration.paymentConfiguration, configuration.language);\r\n }\r\n setCallPaysafe(false);\r\n setDidCallPaysafe(true);\r\n }\r\n }, [\r\n callPaysafe,\r\n configuration.paymentConfiguration,\r\n configuration.language,\r\n giftCardInfo,\r\n dispatch,\r\n configuration.paymentConfiguration.paymentGateway,\r\n configuration.externalLinks.styleUrl,\r\n isPaymentGateWayEnabled,\r\n didCallPaysafe,\r\n ]);\r\n\r\n useEffect(() => {\r\n \r\n if (isPaymentGateWayEnabled && callPaymentGateway) {\r\n setCallPaymentGateway(false);\r\n\r\n var options = {} as any;\r\n options.acceptedPaymentMethods = [\r\n \"Visa\",\r\n \"Maestro\",\r\n \"Mastercard\",\r\n \"American Express\",\r\n \"Diners Club\",\r\n \"Discover\",\r\n \"JCB\",\r\n \"Mada\",\r\n ];\r\n\r\n var computedStyle = getComputedStyle(document.querySelector(\"#content\") as any) as any;\r\n var styleObject = {\r\n color: computedStyle.color,\r\n opacity: computedStyle.opacity,\r\n textDecoration: computedStyle.textDecoration,\r\n fontStyle: computedStyle.fontStyle,\r\n fontWeight: computedStyle.fontWeight,\r\n fontSize: computedStyle.fontSize,\r\n lineHeight: computedStyle.lineHeight,\r\n fontFamily: computedStyle.fontFamily,\r\n invalidColor: computedStyle.invalidColor,\r\n };\r\n\r\n const gcpGatewayConsumerUniqueId = \"21B216ED-69AC-4597-AB32-C4B063D92CDB\";\r\n const creditCardSessionId = billingInfo?.[billing.creditCardSession] || \"N/A\";\r\n\r\n options.paramObj = {\r\n storeFrontCode: CLIENT_ID,\r\n amount: parseInt(removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount])),\r\n origin: configuration.paymentConfiguration.paymentGateway.requestOrigin,\r\n source: gcpGatewayConsumerUniqueId,\r\n baseStyle: JSON.stringify(styleObject),\r\n creditCardSessionId: creditCardSessionId\r\n };\r\n\r\n options.cart = { cart: [], cartTotal: parseInt(removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount])) };\r\n options.hasBackFeature = true;\r\n options.customCss = configuration.externalLinks.styleUrl;\r\n options.gatewayUrl = configuration.paymentConfiguration.paymentGateway.paymentGatewayUrl;\r\n\r\n if (accessibleToggle) {\r\n options.customCss = configuration.externalLinks.accessibleStyleUrl;\r\n options.accessibleOptions = { isAccessible: accessibleToggle, applyAccessibleStyle: accessibleToggle };\r\n }\r\n\r\n window[\"PaymentGateway\"](\"checkout\", options);\r\n window.addEventListener(\"tokenized\", (evt: any) => {\r\n evt.preventDefault();\r\n dispatch(\r\n setBillingInfo({\r\n creditCardName: evt.detail.nameOnCard,\r\n creditCardEmail: evt.detail.email,\r\n creditCardExpirationDate: {\r\n month: evt.detail.expiryMonth,\r\n year: evt.detail.expiryYear,\r\n },\r\n creditCardZipCode: evt.detail.zipCode,\r\n creditCardNumber: evt.detail.last4,\r\n })\r\n );\r\n window[\"PaymentGateway\"].prototype.finalize(\r\n parseInt(removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount])),\r\n {},\r\n true\r\n );\r\n });\r\n window.addEventListener(\"emitError\", (evt: any) => {\r\n evt.preventDefault();\r\n try {\r\n const notificationData = {\r\n sessionUniqueId: configuration.sessionUniqueId,\r\n purchaserEmail: evt.detail.PurchaserEmail,\r\n paymentAuthorizationId: \"\",\r\n errorCode: evt.detail.ErrorCode ? evt.detail.ErrorCode : errorcodes.defaultErrorCode,\r\n errorMessage: evt.detail.ErrorMessage ? evt.detail.ErrorMessage : language.errors.order.processing_failed,\r\n details: JSON.stringify(giftCardInfo),\r\n storeFrontCode: CLIENT_ID,\r\n };\r\n notifyUser(notificationData, `Bearer ${configuration.token}`);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n });\r\n\r\n window.addEventListener(\"callCheckout\", (evt: any) => {\r\n evt.preventDefault();\r\n const pendingAuthorizationId = evt.detail.pendingAuthorizationId;\r\n const email = evt.detail.email;\r\n if (isNonEmptyString(email)) {\r\n dispatch(setBillingInfo({ pendingAuthorizationId, \"creditCardEmail\": email}));\r\n } else {\r\n dispatch(setBillingInfo({ pendingAuthorizationId }));\r\n }\r\n\r\n dispatch(setCurrentPage(pages.ORDER_SUMMARY));\r\n });\r\n window.addEventListener(\"back\", (evt: any) => {\r\n evt.preventDefault();\r\n dispatch(setCurrentPage(pages.AMOUNT_SELECTION));\r\n });\r\n }\r\n }, [\r\n accessibleToggle,\r\n callPaymentGateway,\r\n callPaysafe,\r\n configuration.externalLinks.accessibleStyleUrl,\r\n configuration.externalLinks.styleUrl,\r\n configuration.paymentConfiguration.paymentGateway.paymentGatewayUrl,\r\n configuration.paymentConfiguration.paymentGateway.requestOrigin,\r\n configuration.sessionUniqueId,\r\n configuration.token,\r\n dispatch,\r\n giftCardInfo,\r\n isPaymentGateWayEnabled,\r\n billingInfo[billing.creditCardSession],\r\n language.errors.order.processing_failed,\r\n language.errors.processing,\r\n ]);\r\n\r\n useEffect(() => {\r\n if (window[\"PaymentGateway\"] && !callPaymentGateway && isPaymentGateWayEnabled) {\r\n window[\"PaymentGateway\"].prototype.setAccessibleOptions({\r\n isAccessible: accessibleToggle,\r\n applyAccessibleStyle: accessibleToggle,\r\n });\r\n window[\"PaymentGateway\"].prototype.setCustomCss(\r\n accessibleToggle ? configuration.externalLinks.accessibleStyleUrl : configuration.externalLinks.styleUrl\r\n );\r\n }\r\n }, [\r\n accessibleToggle,\r\n callPaymentGateway,\r\n configuration.externalLinks.accessibleStyleUrl,\r\n configuration.externalLinks.styleUrl,\r\n isPaymentGateWayEnabled,\r\n ]);\r\n\r\n const checkValidation = async () => {\r\n var isTokenizationAvailable = false;\r\n // disable button\r\n setDisableButton(true);\r\n\r\n if (isTokenPayment) {\r\n await triggerValidation([\r\n billing.name,\r\n billing.address,\r\n billing.city,\r\n billing.region,\r\n billing.zipCode,\r\n billing.phoneNumber,\r\n billing.email,\r\n ]);\r\n\r\n window[\"paysafeObject\"][\"validateAllFields\"]((isAllFieldsValid) => {\r\n isTokenizationAvailable = isAllFieldsValid;\r\n });\r\n\r\n if (isEmpty(errors) && isTokenizationAvailable) {\r\n const orderData = {\r\n billing: {\r\n name: billingInfo[billing.name],\r\n creditCardNumber: billingInfo[billing.number].replace(/\\s/g, \"\"),\r\n creditCardType: billingInfo[billing.issuer],\r\n cvd: billingInfo[billing.cvd],\r\n expiryMonth: billingInfo[billing.expirationDate].month,\r\n expiryYear: billingInfo[billing.expirationDate].year,\r\n phone: billingInfo[billing.phoneNumber],\r\n addressLine1: billingInfo[billing.address],\r\n addressLine2: billingInfo[billing.address2],\r\n city: billingInfo[billing.city],\r\n postalZip: billingInfo[billing.zipCode],\r\n regionId: billingInfo[billing.region].id,\r\n regionName: billingInfo[billing.region].name,\r\n countryId: billingInfo[billing.country].id,\r\n email: billingInfo[billing.email],\r\n },\r\n reloadAmount: removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount]),\r\n };\r\n\r\n window[\"paysafeObject\"][\"getPaysafeToken\"](orderData, (token) => {\r\n setPaysafeSingleUseToken(token);\r\n if (token !== \"\") {\r\n setIsPageValid(true);\r\n setDisplayErrors(false);\r\n }\r\n });\r\n } else {\r\n setDisplayErrors(true);\r\n if (errors.creditCardRegion) {\r\n dispatch(getRegions(country[\"id\"], languageCode));\r\n }\r\n }\r\n } else {\r\n await triggerValidation([\r\n billing.number,\r\n billing.name,\r\n billing.cvd,\r\n billing.address,\r\n billing.city,\r\n billing.region,\r\n billing.zipCode,\r\n billing.phoneNumber,\r\n billing.email,\r\n ]);\r\n\r\n if (isEmpty(errors)) {\r\n setIsPageValid(true);\r\n setDisplayErrors(false);\r\n } else {\r\n setDisplayErrors(true);\r\n if (errors.creditCardRegion) {\r\n dispatch(getRegions(country[\"id\"], languageCode));\r\n }\r\n }\r\n }\r\n\r\n //enable button\r\n setDisableButton(false);\r\n };\r\n\r\n useEffect(() => {\r\n dispatch(setBillingInfo({ paysafeSingleUseToken }));\r\n }, [paysafeSingleUseToken, dispatch]);\r\n\r\n useEffect(() => {\r\n // move to next page if everything is valid\r\n isPageValid && dispatch(setCurrentPage(pages.ORDER_SUMMARY));\r\n }, [dispatch, isPageValid]);\r\n\r\n return (\r\n <>\r\n {isPaymentGateWayEnabled ? (\r\n \r\n \r\n }\r\n />\r\n \r\n ) : (\r\n \r\n {showContrastToggle &&

    {language.payment_info.page_title}

    }\r\n \r\n \r\n \r\n \r\n {\r\n dispatch(setCurrentPage(pages.AMOUNT_SELECTION));\r\n }}\r\n />\r\n {\r\n checkValidation();\r\n }}\r\n testRole='primary-button'\r\n />\r\n \r\n }\r\n />\r\n \r\n )}\r\n \r\n );\r\n};\r\n","import React, { useEffect, useRef } from \"react\";\r\nimport { formatCurrency } from \"../utils\";\r\nimport uniqid from \"uniqid\";\r\nimport { useSelector } from \"react-redux\";\r\n\r\nexport default ({ val, focus, index, setFocus, currencySign, languageCode, currencyCode, handleSelect }) => {\r\n const buttonRef = useRef(null);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n \r\n let valLabel = currencySign + formatCurrency(val, languageCode, currencyCode);\r\n\r\n const currencyPosition = configuration.culture.currencyPositionId;\r\n\r\n if (languageCode === \"fr\" || currencyPosition === 2) {\r\n valLabel = formatCurrency(val, languageCode, currencyCode) + currencySign;\r\n }\r\n\r\n useEffect(() => {\r\n if (focus && buttonRef.current) {\r\n // Move element into view when it is focused\r\n buttonRef.current.focus();\r\n }\r\n }, [focus]);\r\n\r\n return (\r\n \r\n {valLabel}\r\n \r\n );\r\n};\r\n","import React from \"react\";\r\nimport { formatCurrency, useCurrencyPosition } from \"../utils\";\r\nimport HalfButton from \"./HalfButton\";\r\nimport { useRoveFocus } from \"../hooks\";\r\n\r\ninterface IAmountSelectionField {\r\n id: string;\r\n label: string;\r\n legend: string;\r\n placeholder?: string;\r\n languageCode?: string;\r\n description: string;\r\n currencySign?: string;\r\n currencyCode?: string;\r\n initialAmount: number;\r\n value: number | string;\r\n minimumValue: number;\r\n maximumValue: number;\r\n range: number[];\r\n validationError?: any;\r\n validation?: (ref: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null) => void;\r\n handleChange: (event: React.ChangeEvent) => void;\r\n handleSelect: (\r\n event: React.KeyboardEvent | React.MouseEvent\r\n ) => void;\r\n handleFocus: (\r\n event:\r\n | React.KeyboardEvent\r\n | React.MouseEvent\r\n | React.FocusEvent\r\n ) => void;\r\n handleBlur: (event: React.ChangeEvent) => void;\r\n}\r\n\r\nexport default (field: IAmountSelectionField) => {\r\n // default props\r\n const { currencySign = \"$\", currencyCode = \"USD\", languageCode = \"en\" } = field;\r\n\r\n const maximumValue = formatCurrency(field.maximumValue, languageCode, currencyCode);\r\n const minimumValue = formatCurrency(field.minimumValue, languageCode, currencyCode);\r\n\r\n const description = `${field.description} ${useCurrencyPosition(minimumValue, currencySign)} - ${useCurrencyPosition(\r\n maximumValue,\r\n currencySign\r\n )} ${currencyCode}`;\r\n const [focus, setFocus] = useRoveFocus(field.range.length);\r\n const isInvalid = typeof field.validationError !== \"undefined\";\r\n const errorMessage = field.validationError ? field.validationError.message : \"\";\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n
    {errorMessage}
    \r\n
    \r\n
    \r\n
    \r\n \r\n {currencySign}\r\n \r\n {description}\r\n
    \r\n
    \r\n
    \r\n {field.legend}\r\n
    \r\n {field.range.map((val, index) => (\r\n \r\n ))}\r\n
    \r\n
    \r\n
    \r\n \r\n );\r\n};\r\n","import React, { useState, useEffect } from \"react\";\r\nimport PageNavigation from \"../../components/PageNavigation\";\r\nimport AmountSelectionField from \"../../components/AmountSelectionField\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { giftCard, pages, reload, validationType } from \"../../constants\";\r\nimport { setGiftCardInfo, setCurrentPage } from \"../../actions\";\r\nimport { formatCurrency, removeNonNumeric, isEmpty, useCurrencyPosition } from \"../../utils\";\r\nimport Button from \"../../components/Button\";\r\nimport { useForm } from \"react-hook-form\";\r\n\r\nimport { createCreditCardSession } from \"../../actions/billing.actions\";\r\n\r\nexport const AmountSelection = () => {\r\n const dispatch = useDispatch();\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const giftCardInfo = useSelector((state: any) => state.giftCard);\r\n const language = useSelector((state: any) => state.language);\r\n const { validation } = language.errors;\r\n const { minimumValue, maximumValue, defaultAmount, currencyCode, currencySign, denominationRange } =\r\n configuration.amount;\r\n const { languageCode } = configuration.language;\r\n const { amount_info } = language;\r\n const { amount } = amount_info;\r\n const { register, errors, clearError, triggerValidation, setError } = useForm({ mode: \"onBlur\" });\r\n const [isPageValid, setIsPageValid] = useState(false);\r\n const [displayErrors, setDisplayErrors] = useState(false);\r\n const [disableButton, setDisableButton] = useState(false);\r\n const { showContrastToggle } = configuration.storefront || false;\r\n const { reloadCardSession } = configuration;\r\n\r\n\r\n const amountIsOverMax = (value: any) => {\r\n value = parseInt(removeNonNumeric(value));\r\n const balance = parseFloat(giftCardInfo[giftCard.cardBalance]);\r\n return value + balance > maximumValue;\r\n };\r\n\r\n const amountIsUnderMin = (value: any) => {\r\n value = parseInt(removeNonNumeric(value));\r\n return value < minimumValue;\r\n };\r\n\r\n const handleBlur = (event: React.ChangeEvent) => {\r\n if (amountIsOverMax(event.target.value)) {\r\n setError(reload.amount, \"amountIsOverMax\", validation.exceeds_max_amount);\r\n return;\r\n } else {\r\n clearError(reload.amount);\r\n }\r\n\r\n if (amountIsUnderMin(event.target.value) || parseInt(event.target.value) < 0) {\r\n setError(reload.amount, \"amountIsUnderMin\", validation.amount_under_min);\r\n }\r\n };\r\n const handleChange = (event: React.ChangeEvent) => {\r\n if (event) {\r\n dispatch(setGiftCardInfo({ [giftCard.cardReloadAmount]: removeNonNumeric(event.target.value) }));\r\n }\r\n };\r\n\r\n const handleSelect = (\r\n event: React.KeyboardEvent | React.MouseEvent\r\n ) => {\r\n const button = event.target as HTMLButtonElement;\r\n\r\n if (amountIsOverMax(button.value)) return;\r\n\r\n dispatch(setGiftCardInfo({ [giftCard.cardReloadAmount]: button.value }));\r\n clearError(reload.amount);\r\n };\r\n\r\n const handleFocus = (\r\n event:\r\n | React.KeyboardEvent\r\n | React.MouseEvent\r\n | React.FocusEvent\r\n ) => {\r\n clearError();\r\n };\r\n\r\n const checkValidation = async () => {\r\n // disable button\r\n setDisableButton(true);\r\n\r\n await triggerValidation([reload.amount]);\r\n if (reloadCardSession) { // Only dispatch if reloadCardSession is present\r\n dispatch(createCreditCardSession());\r\n }\r\n //enable button\r\n setDisableButton(false);\r\n\r\n if (isEmpty(errors)) {\r\n setIsPageValid(true);\r\n setDisplayErrors(false);\r\n } else {\r\n if (errors != null && errors[reload.amount] != null) {\r\n let error = errors[reload.amount] as any;\r\n if (error.type === \"belowMinimum\") {\r\n setError(reload.amount, \"amountIsUnderMin\", validation.amount_under_min);\r\n }\r\n\r\n if (error.type === \"aboveMaximum\") {\r\n setError(reload.amount, \"amountIsOverMax\", validation.exceeds_max_amount);\r\n }\r\n }\r\n setDisplayErrors(true);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n // if form are valid...\r\n isPageValid &&\r\n // move to the next page\r\n dispatch(setCurrentPage(pages.PAYMENT_INFORMATION));\r\n }, [dispatch, isPageValid]);\r\n return (\r\n \r\n {showContrastToggle &&

    {amount_info.page_title}

    }\r\n

    \r\n {amount_info.gift_card_number} { reloadCardSession?.maskedCardNumber ?? giftCardInfo[giftCard.cardNumber]}\r\n

    \r\n

    \r\n {amount.section_title}\r\n \r\n {useCurrencyPosition(\r\n formatCurrency(giftCardInfo[giftCard.cardBalance], languageCode, currencyCode),\r\n currencySign\r\n )}\r\n {currencyCode}\r\n \r\n

    \r\n

    \r\n {amount_info.maximum_amount}\r\n \r\n {useCurrencyPosition(formatCurrency(maximumValue, languageCode, currencyCode), currencySign)} {currencyCode}\r\n \r\n

    \r\n
    \r\n {amount.legend_description}\r\n !amountIsUnderMin(value) && !(parseInt(value) < 0),\r\n aboveMaximum: (value) => !amountIsOverMax(value),\r\n },\r\n })}\r\n />\r\n
    \r\n\r\n \r\n {\r\n dispatch(setCurrentPage(pages.GIFT_CARD_INFORMATION));\r\n }}\r\n />\r\n {\r\n checkValidation();\r\n }}\r\n testRole='primary-button'\r\n />\r\n \r\n }\r\n />\r\n \r\n );\r\n};\r\n","import React from 'react'\r\n\r\ninterface ITerms {\r\n handleChange: (event: React.ChangeEvent) => void,\r\n validation?: any,\r\n label: string,\r\n id: string,\r\n isCheckboxVisible?: boolean\r\n}\r\n\r\nconst createMarkup = (source: string) => { \r\n return {__html: source}\r\n}\r\n\r\nexport const Terms = (terms: ITerms) => {\r\n \r\n const {isCheckboxVisible = true, label, id, validation, handleChange} = terms\r\n const wrapClass = isCheckboxVisible ? \"checkbox-wrap\" : \"checkbox-wrap no-checkbox\"\r\n\r\n return (\r\n
    \r\n {isCheckboxVisible && \r\n \r\n }\r\n \r\n
    \r\n )\r\n}\r\n\r\nexport default Terms","import React from 'react'\r\n\r\ninterface IOptIn {\r\n handleChange: (event: React.ChangeEvent) => void,\r\n validation?: any,\r\n label: string,\r\n id: string,\r\n isOptInEnabled: boolean\r\n}\r\n\r\nconst createMarkup = (source: string) => { \r\n return {__html: source}\r\n}\r\n\r\nexport const OptIn = (optIn: IOptIn) => {\r\n \r\n const {isOptInEnabled = false, label, id, validation, handleChange} = optIn\r\n const wrapClass = isOptInEnabled ? \"checkbox-wrap\" : \"checkbox-wrap no-checkbox\"\r\n\r\n return (\r\n
    \r\n {isOptInEnabled && \r\n \r\n }\r\n {isOptInEnabled && \r\n
    \r\n )\r\n}\r\n\r\nexport default OptIn","import React, { useState, useCallback } from \"react\";\r\nimport PageNavigation from \"../../components/PageNavigation\";\r\nimport Button from \"../../components/Button\";\r\nimport { pages, terms, validationType, CLIENT_ID, API, billing, giftCard, errorcodes } from \"../../constants\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { setCurrentPage, submitOrder, setBillingInfo } from \"../../actions\";\r\nimport {\r\n getRegionLabel,\r\n getZipLabel,\r\n formatCurrency,\r\n enforceNumber,\r\n getLastFourCharacters,\r\n getExpirationDate,\r\n getRegionName,\r\n isEmpty,\r\n useCurrencyPosition,\r\n removeNonNumeric,\r\n} from \"../../utils\";\r\nimport CreditCardIssuer from \"../../components/CreditCardIssuer\";\r\nimport Terms from \"../../components/Terms\";\r\nimport { useForm } from \"react-hook-form\";\r\nimport { HalfCircleSpinner } from \"react-epic-spinners\";\r\nimport OptIn from \"../../components/OptIn\";\r\nimport { notifyUser } from \"../../actions/giftcard.actions\";\r\n\r\nexport const OrderSummary = () => {\r\n const dispatch = useDispatch();\r\n const language = useSelector((state: any) => state.language);\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const giftCardInfo = useSelector((state: any) => state.giftCard);\r\n const [isOptInChecked, setOptInChecked] = useState(false);\r\n const { order_summary } = language;\r\n const { validation } = language.errors;\r\n const { gift_card, payment_info, billing_info } = order_summary.summary.fields;\r\n const { region, zip_postal } = language.payment_info.billing_info.fields;\r\n const [buyatabTermsChecked, setBuyatabTermsChecked] = useState(false);\r\n const [clientTermsChecked, setClientTermsChecked] = useState(false);\r\n const { buyatabLabel, storefrontLabel, shouldDisplayStoreFrontTerms, isCheckboxVisible, isCheckboxRequired } =\r\n configuration.termsAndConditions;\r\n const { register, errors, triggerValidation, setError } = useForm({ mode: \"onChange\", submitFocusError: false });\r\n const { currencySign, currencyCode } = configuration.amount;\r\n const { languageCode } = language;\r\n const [displayErrors, setDisplayErrors] = useState(false);\r\n const [disableButton, setDisableButton] = useState(false);\r\n const { isOptInEnabled, optInHtml } = configuration.storefront;\r\n const { isTokenPayment } = configuration.paymentConfiguration || false;\r\n\r\n const handleChange = (event: React.ChangeEvent) => {\r\n if (event.target.id === terms.buyatabTerms) {\r\n setBuyatabTermsChecked(!buyatabTermsChecked);\r\n } else {\r\n setClientTermsChecked(!clientTermsChecked);\r\n }\r\n };\r\n\r\n const handleOptIn = (event: React.ChangeEvent) => {\r\n const newValue = !isOptInChecked;\r\n setOptInChecked(newValue);\r\n dispatch(setBillingInfo({ [billing.optIn]: newValue }));\r\n };\r\n\r\n const checkValidation = async () => {\r\n if (!disableButton) {\r\n setDisableButton(true);\r\n await triggerValidation([\r\n terms.buyatabTerms,\r\n shouldDisplayStoreFrontTerms && isCheckboxVisible && isCheckboxRequired ? terms.clientTerms : \"\",\r\n ]);\r\n\r\n if (isEmpty(errors)) {\r\n // no errors!\r\n setDisplayErrors(false);\r\n callSubmitOrder();\r\n } else {\r\n setDisplayErrors(true);\r\n setDisableButton(false);\r\n }\r\n }\r\n };\r\n\r\n const callSubmitOrder = useCallback(() => {\r\n var billingData;\r\n if (billingInfo[billing.pendingAuthorizationId]) {\r\n billingData = {\r\n pendingAuthorizationId: billingInfo[billing.pendingAuthorizationId],\r\n };\r\n } else {\r\n var issuer = billingInfo[billing.issuer];\r\n if (issuer === undefined || issuer === null) {\r\n issuer = localStorage.getItem(\"CcIssuer\");\r\n }\r\n\r\n billingData = {\r\n name: billingInfo[billing.name],\r\n creditCardNumber: billingInfo[billing.number].replace(/\\s/g, \"\"),\r\n creditCardType: issuer,\r\n cvd: billingInfo[billing.cvd],\r\n expiryMonth: billingInfo[billing.expirationDate].month,\r\n expiryYear: billingInfo[billing.expirationDate].year,\r\n phone: billingInfo[billing.phoneNumber],\r\n addressLine1: billingInfo[billing.address],\r\n addressLine2: billingInfo[billing.address2],\r\n city: billingInfo[billing.city],\r\n postalZip: billingInfo[billing.zipCode],\r\n regionId: billingInfo[billing.region].id,\r\n regionName: billingInfo[billing.region].name,\r\n countryId: billingInfo[billing.country].id,\r\n email: billingInfo[billing.email],\r\n singleUseToken: billingInfo[billing.paysafeSingleUseToken],\r\n pendingAuthorizationId: billingInfo[billing.pendingAuthorizationId],\r\n };\r\n }\r\n\r\n const orderData = {\r\n card: {\r\n cardNumber: giftCardInfo[giftCard.cardNumber].replace(/\\s/g, \"\"),\r\n cardPin: giftCardInfo[giftCard.cardPin].replace(/\\s/g, \"\"),\r\n },\r\n billing: billingData,\r\n cartToken: configuration.riskifiedInfo.riskifiedBeaconKey,\r\n reloadAmount: parseInt(removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount])),\r\n storefrontCode: CLIENT_ID,\r\n isOptInChecked: billingInfo[billing.optIn],\r\n signifydBeaconKey: configuration.signifydBeaconKey,\r\n };\r\n\r\n dispatch(\r\n submitOrder(\r\n orderData,\r\n () => {\r\n dispatch(setCurrentPage(pages.ORDER_CONFIRMATION));\r\n },\r\n (response: any) => {\r\n setError(\r\n giftCard.cardNumber,\r\n API.SUBMIT_ORDER_FAILED,\r\n //TODO: localization to be done in future ticket.\r\n response && response.errorMessage ? response.errorMessage : language.errors.order.processing_failed\r\n );\r\n setDisplayErrors(true);\r\n setDisableButton(false);\r\n try {\r\n if (configuration.sessionUniqueId) {\r\n const notificationData = {\r\n sessionUniqueId: configuration.sessionUniqueId,\r\n purchaserEmail: billingInfo[billing.email],\r\n paymentAuthorizationId: billingInfo[billing.pendingAuthorizationId],\r\n errorCode: response && response.errorCode ? response.errorCode : errorcodes.defaultErrorCode,\r\n errorMessage:\r\n response && response.errorMessage ? response.errorMessage : language.errors.order.processing_failed,\r\n details: JSON.stringify(orderData),\r\n storeFrontCode: CLIENT_ID,\r\n };\r\n notifyUser(notificationData, `Bearer ${configuration.token}`);\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n )\r\n );\r\n }, [\r\n billingInfo,\r\n configuration.riskifiedInfo.riskifiedBeaconKey,\r\n configuration.sessionUniqueId,\r\n configuration.signifydBeaconKey,\r\n configuration.token,\r\n dispatch,\r\n giftCardInfo,\r\n language.errors.order.processing_failed,\r\n setError,\r\n ]);\r\n\r\n return (\r\n \r\n

    {order_summary.page_title}

    \r\n
    \r\n {order_summary.summary.legend_description}\r\n\r\n
    \r\n \r\n

    {gift_card.title}

    \r\n
    \r\n
    {gift_card.current_balance}
    \r\n \r\n {useCurrencyPosition(\r\n formatCurrency(giftCardInfo[giftCard.cardBalance], languageCode, currencyCode),\r\n currencySign\r\n )}\r\n {currencyCode}\r\n \r\n
    \r\n
    \r\n
    {gift_card.reload_amount}
    \r\n \r\n {useCurrencyPosition(\r\n formatCurrency(removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount]), languageCode, currencyCode),\r\n currencySign\r\n )}\r\n {currencyCode}\r\n \r\n
    \r\n
    \r\n
    {gift_card.new_balance}
    \r\n \r\n {useCurrencyPosition(\r\n formatCurrency(\r\n giftCardInfo[giftCard.cardBalance] +\r\n enforceNumber(removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount])),\r\n languageCode,\r\n currencyCode\r\n ),\r\n currencySign\r\n )}\r\n {currencyCode}\r\n \r\n
    \r\n
    \r\n\r\n {!isTokenPayment && !billingInfo.pendingAuthorizationId && (\r\n
    \r\n

    {payment_info.title}

    \r\n
    \r\n
    \r\n {\r\n return billingInfo[billing.issuer];\r\n }}\r\n />\r\n
    \r\n \r\n {payment_info.ending_in} {getLastFourCharacters(billingInfo[billing.number])}\r\n \r\n
    \r\n
    \r\n
    {payment_info.expiry_date}
    \r\n {getExpirationDate(billingInfo[billing.expirationDate])}\r\n
    \r\n
    \r\n )}\r\n \r\n\r\n
    \r\n
    \r\n

    {billing_info.title}

    \r\n
    \r\n
    {billing_info.email_address}
    \r\n {billingInfo[billing.email]}\r\n
    \r\n {billingInfo[billing.phoneNumber] && (\r\n
    \r\n
    {billing_info.phone_number}
    \r\n {billingInfo[billing.phoneNumber]}\r\n
    \r\n )}\r\n {billingInfo[billing.address] && (\r\n
    \r\n
    {billing_info.address}
    \r\n \r\n {billingInfo[billing.address]} {billingInfo[billing.address2] && billingInfo[billing.address2]}\r\n \r\n
    \r\n )}\r\n {billingInfo[billing.city] && (\r\n
    \r\n
    {billing_info.city}
    \r\n {billingInfo[billing.city]}\r\n
    \r\n )}\r\n {!billingInfo.pendingAuthorizationId && (\r\n
    \r\n
    {getRegionLabel(billingInfo[billing.country], region)}:
    \r\n {getRegionName(billingInfo[billing.region])}\r\n
    \r\n )}\r\n {!billingInfo.pendingAuthorizationId && (\r\n
    \r\n
    {billing_info.country}
    \r\n {billingInfo[billing.country].name}\r\n
    \r\n )}\r\n {!billingInfo.pendingAuthorizationId && (\r\n
    \r\n
    {getZipLabel(billingInfo[billing.country], zip_postal)}:
    \r\n {billingInfo[billing.zipCode]}\r\n
    \r\n )}\r\n
    \r\n
    \r\n\r\n
    \r\n \r\n {!billingInfo.pendingAuthorizationId && (\r\n \r\n )}\r\n\r\n {!billingInfo.pendingAuthorizationId && shouldDisplayStoreFrontTerms && (\r\n \r\n )}\r\n
    \r\n
    \r\n\r\n \r\n {\r\n dispatch(setCurrentPage(pages.PAYMENT_INFORMATION));\r\n }}\r\n />\r\n \r\n ) : (\r\n language.page_navigation.checkout_button_label\r\n )\r\n }\r\n isDisabled={disableButton}\r\n isPrimary={true}\r\n // handleOnClick={handleCheckoutClick}\r\n handleOnClick={checkValidation}\r\n testRole='primary-button'\r\n />\r\n \r\n }\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default OrderSummary;\r\n","import React, { useEffect } from 'react'\r\nimport PageNavigation from '../../components/PageNavigation'\r\nimport Button from '../../components/Button'\r\nimport { billing, giftCard } from '../../constants'\r\nimport { useSelector } from 'react-redux'\r\nimport { getReturnUrl, removeNonNumeric } from '../../utils'\r\n\r\nwindow['dataLayer'] = window['dataLayer'] || [];\r\n\r\nexport default () => {\r\n const billingInfo = useSelector((state: any) => state.billing)\r\n const configuration = useSelector((state: any) => state.configuration)\r\n const giftCardInfo = useSelector((state: any) => state.giftCard)\r\n const language = useSelector((state: any) => state.language)\r\n const reloadCardSession = configuration.reloadCardSession;\r\n\r\n const { order_confirmation } = language\r\n\r\n useEffect(() => {\r\n\r\n const orderConfirmData = {\r\n 'event': 'eCommerceGA',\r\n 'transactionId': giftCardInfo[giftCard.orderNumber],\r\n 'transactionAffiliation': configuration.storefront.storefrontName,\r\n 'transactionTotal': removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount]),\r\n 'transactionTax': 0,\r\n 'transactionShipping': 0,\r\n 'transactionCurency': configuration.amount.currencyCode,\r\n 'transactionDatePaymentType': 'N/A',\r\n 'transactionPromoCode': 'N/A',\r\n 'transactionShippingMethod': 'N/A',\r\n 'transactionType': 'Sale',\r\n 'transactionProducts': [{\r\n sku: giftCardInfo[giftCard.orderNumber],\r\n name: 'Card Reload',\r\n category: 'Gift Card',\r\n price: removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount]),\r\n quantity: 1\r\n }]\r\n }\r\n\r\n const enhancedData = {\r\n 'event': 'purchase',\r\n 'ecommerce': {\r\n 'currencyCode': configuration.amount.currencyCode,\r\n 'purchase': {\r\n 'actionField': {\r\n 'id': giftCardInfo[giftCard.orderNumber],\r\n 'affiliation': configuration.storefront.storefrontName,\r\n 'revenue': removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount]),\r\n 'tax': 0,\r\n 'shipping': 0,\r\n 'coupon': 'N/A'\r\n },\r\n 'products': [{\r\n name: 'Card Reload',\r\n id: giftCardInfo[giftCard.orderNumber],\r\n price: removeNonNumeric(giftCardInfo[giftCard.cardReloadAmount]),\r\n brand: configuration.storefront.storefrontName,\r\n category: 'Gift Card',\r\n variant: 'Reload',\r\n quantity: 1\r\n }]\r\n }\r\n }\r\n }\r\n\r\n window['dataLayer'].push(orderConfirmData)\r\n window['dataLayer'].push(enhancedData)\r\n })\r\n\r\n return (\r\n
    \r\n

    {order_confirmation.page_title}

    \r\n

    {order_confirmation.order_number} {giftCardInfo[giftCard.orderNumber]}

    \r\n

    {order_confirmation.email} {billingInfo[billing.email]}

    \r\n \r\n \r\n {\r\n\r\n if(reloadCardSession){\r\n const urlToRedirect = getReturnUrl('OrderConfirmation');\r\n if(urlToRedirect){\r\n window.location.replace(urlToRedirect);\r\n return;\r\n }\r\n }\r\n\r\n window.location.reload(false);\r\n }}\r\n testRole=\"primary-button\"\r\n />\r\n \r\n }\r\n />\r\n
    \r\n )\r\n }\r\n","import React from 'react'\r\nimport PageNavigation from '../../components/PageNavigation'\r\nimport Button from '../../components/Button'\r\nimport { useSelector } from 'react-redux'\r\n\r\nexport default () => {\r\n const language = useSelector((state: any) => state.language) \r\n\r\n return (\r\n <>\r\n

    {language.error_page.page_title}

    \r\n

    {language.error_page.page_body}

    \r\n \r\n {\r\n window.location.reload(false)\r\n }}\r\n testRole=\"primary-button\"\r\n /> \r\n \r\n }\r\n />\r\n \r\n )\r\n}","import React, { useCallback } from 'react'\r\nimport { useSelector, useDispatch } from 'react-redux'\r\nimport { useForm } from \"react-hook-form\"\r\nimport Field from '../../../components/Field'\r\nimport PageNavigation from '../../../components/PageNavigation'\r\nimport { setCurrentPage } from '../../../actions'\r\nimport { formatNumbers } from '../../../utils'\r\nimport RecaptchaField from '../../../components/RecaptchaField'\r\nimport Button from '../../../components/Button'\r\nimport { giftCard, pages, validationType } from '../../../constants'\r\n\r\nexport default () => {\r\n const dispatch = useDispatch();\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const language = useSelector((state: any) => state.language);\r\n const { register, errors } = useForm({ mode: \"onBlur\", submitFocusError: false });\r\n const { showPin, isPinRequired } = configuration.storefront;\r\n const { languageCode } = configuration.language;\r\n const { validation } = language.errors;\r\n const recaptchaRef = React.createRef();\r\n const { showContrastToggle } = configuration.storefront || false;\r\n\r\n const handleFieldChange = useCallback((event: React.ChangeEvent) => {\r\n event.target.value = formatNumbers(event.target.value);\r\n }, []);\r\n\r\n const { gift_card_info: { page_title, gift_card } } = language;\r\n const { number, pin, recaptcha } = gift_card.fields;\r\n\r\n return (\r\n
    \r\n {showContrastToggle &&

    {page_title}

    }\r\n\r\n
    \r\n {showContrastToggle &&

    {gift_card.section_title}

    }\r\n\r\n
    \r\n {gift_card.legend_description}\r\n {showContrastToggle &&

    {language.form_message}

    }\r\n \r\n\r\n {showPin &&\r\n \r\n }\r\n\r\n { return; }}\r\n recaptchaRef={recaptchaRef}/>\r\n\r\n
    \r\n
    \r\n\r\n \r\n {\r\n dispatch(setCurrentPage(pages.PAYMENT_INFORMATION))\r\n }}\r\n testRole=\"primary-button\"\r\n />\r\n \r\n }/>\r\n
    \r\n );\r\n}\r\n","import React, { useCallback, useRef } from 'react'\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport ExpirationDateField from '../../../components/ExpirationDateField'\r\nimport Field from '../../../components/Field'\r\nimport CreditCardIssuer from \"../../../components/CreditCardIssuer\"\r\nimport { setBillingInfo } from \"../../../actions\"\r\nimport { formatCreditCardNumber, formatCVC } from \"../../../utils\"\r\nimport { billing, validationType } from \"../../../constants\"\r\nimport { useCreditCardValidation } from '../../../hooks'\r\n\r\nexport default (props) => {\r\n const dispatch = useDispatch();\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const language = useSelector((state: any) => state.language);\r\n const { year, month } = configuration.serverDate;\r\n const { cvdUrl } = configuration.externalLinks;\r\n const { credit_card } = language.payment_info;\r\n const { number, name, expiration_date, cvd } = credit_card.fields;\r\n const expirationDateRef = useRef(null);\r\n const { validation } = language.errors;\r\n const { showContrastToggle } = configuration.storefront || false;\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n if (event.target.id === billing.number) {\r\n event.target.value = formatCreditCardNumber(event.target.value);\r\n }\r\n if (event.target.id === billing.cvd) {\r\n event.target.value = formatCVC(event.target.value);\r\n }\r\n }, []);\r\n\r\n const handleIssuer = (issuer: string) => {\r\n dispatch(setBillingInfo({ [billing.issuer]: issuer }));\r\n }\r\n\r\n return (\r\n
    \r\n {showContrastToggle &&

    {credit_card.section_title}

    }\r\n\r\n
    \r\n {credit_card.legend_description}\r\n {showContrastToggle &&

    {language.form_message}

    }\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n { return }}/>\r\n\r\n \r\n {cvd.detail}\r\n \r\n }\r\n required={true}\r\n value={billingInfo[billing.cvd]}\r\n handleChange={handleFieldChange}\r\n validationError={props.validationForm.errors[billing.cvd]}\r\n validation={props.validationForm.register({ required: validation[validationType.required] }) }/>\r\n\r\n
    \r\n
    \r\n );\r\n}","import React, { useState, useEffect, useCallback } from 'react'\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport Field from '../../../components/Field'\r\nimport SelectField from \"../../../components/SelectField\"\r\nimport RegionsField from \"../../../components/RegionsField\"\r\nimport { setBillingInfo, getRegions, getCountryById } from \"../../../actions\"\r\nimport { formatCreditCardNumber, getRegionLabel, getZipLabel, getZipValidationType, formatZipCode, hasNoPostalcode } from \"../../../utils\"\r\nimport { billing, validationType, INVALID_OPTION } from \"../../../constants\"\r\n\r\nexport default (props) => {\r\n const dispatch = useDispatch();\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const regions = useSelector((state: any) => state.regions);\r\n const language = useSelector((state: any) => state.language);\r\n const { defaultCountry, billingCountries } = configuration.billingCountry;\r\n const { languageCode } = configuration.language;\r\n const { billing_info } = language.payment_info;\r\n const { validation } = language.errors;\r\n const { address, address2, city, country, region, zip_postal } = billing_info.fields;\r\n const { validationRules } = configuration;\r\n const [zipcodePattern, setZipcodePattern] = useState();\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n if (event) {\r\n\r\n if (event.target.id === billing.number) {\r\n event.target.value = formatCreditCardNumber(event.target.value);\r\n }\r\n\r\n if (event.target.id === billing.zipCode) {\r\n event.target.value =\r\n formatZipCode(event.target.value, billingInfo[billing.country].id || defaultCountry) || '';\r\n }\r\n }\r\n }, [billingInfo, defaultCountry]);\r\n\r\n //useCallback here seems to resolve the performance issue\r\n const handleSelectChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n const { id, value } = event.target;\r\n\r\n if (id === billing.country) {\r\n const name = getCountryById(value, configuration.billingCountry.billingCountries).name;\r\n dispatch(setBillingInfo({ [billing.country]: { 'id': value, name } }));\r\n dispatch(setBillingInfo({ [billing.region]: { 'id': -1, 'name': '' } }));\r\n dispatch(setBillingInfo({ [billing.zipCode]: '' }));\r\n\r\n props.validationForm.clearError(billing.zipCode);\r\n dispatch(getRegions(value, languageCode));\r\n }\r\n }, [configuration.billingCountry.billingCountries, dispatch, languageCode, props.validationForm]);\r\n\r\n const handleRegionsChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n let id: string, name: string;\r\n if (event.target.tagName === 'SELECT') {\r\n const index = (event.nativeEvent.target! as HTMLSelectElement).selectedIndex;\r\n name = event.nativeEvent.target![index].text;\r\n id = event.target.value;\r\n } else {\r\n name = event.target.value;\r\n id = '-1';\r\n }\r\n dispatch(setBillingInfo({ [billing.region]: { id, name } }));\r\n }, [dispatch]);\r\n\r\n useEffect(() => {\r\n if (validationRules[getZipValidationType(billingInfo[billing.country].id)]) {\r\n const expression = new RegExp(validationRules[getZipValidationType(billingInfo[billing.country].id)]);\r\n setZipcodePattern(expression);\r\n } else {\r\n setZipcodePattern(new RegExp(''));\r\n }\r\n }, [billingInfo, validationRules]);\r\n\r\n return (\r\n
    \r\n

    {billing_info.section_title}

    \r\n
    \r\n {billing_info.legend_description}\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n {\r\n if (value === INVALID_OPTION) {\r\n return region.detail +\r\n getRegionLabel(billingInfo[billing.country].id || defaultCountry, region)\r\n }\r\n }\r\n }\r\n }) }\r\n defaultOptionLabel={region.detail +\r\n getRegionLabel(billingInfo[billing.country].id || defaultCountry, region)}/>\r\n\r\n \r\n\r\n
    \r\n
    \r\n );\r\n}","import React, { useCallback } from 'react'\r\nimport Field from '../../../components/Field'\r\nimport { useSelector } from 'react-redux'\r\nimport { formatCreditCardNumber } from \"../../../utils\"\r\nimport { billing, validationType } from \"../../../constants\"\r\n\r\nexport default (props) => {\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const language = useSelector((state: any) => state.language);\r\n const { purchaser } = language.payment_info;\r\n const { phone_number, email } = purchaser.fields;\r\n const { validation } = language.errors;\r\n const { validationRules } = configuration;\r\n\r\n const handleFieldChange = useCallback(\r\n (event: React.ChangeEvent) => {\r\n if (event) {\r\n\r\n if (event.target.id === billing.number) {\r\n event.target.value = formatCreditCardNumber(event.target.value);\r\n }\r\n }\r\n }, []);\r\n\r\n return (\r\n
    \r\n

    {purchaser.section_title}

    \r\n
    \r\n {purchaser.legend_description}\r\n\r\n \r\n\r\n \r\n\r\n
    \r\n
    \r\n );\r\n}","import React, { useMemo } from 'react'\r\nimport { useForm } from 'react-hook-form'\r\nimport CreditCardInformationPreview from \"./CreditCardInformationPreview\"\r\nimport BillingInformationPreview from \"./BillingInformationPreview\"\r\nimport PurchaserInformationPreview from \"./PurchaserInformationPreview\"\r\nimport PageNavigation from \"../../../components/PageNavigation\"\r\nimport Button from \"../../../components/Button\";\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { setCurrentPage } from '../../../actions'\r\nimport { pages } from '../../../constants'\r\n\r\nexport default () => {\r\n const dispatch = useDispatch();\r\n const language = useSelector((state: any) => state.language);\r\n const { register, errors, clearError } = useForm({ mode: \"onBlur\" });\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const { showContrastToggle } = configuration.storefront || false;\r\n\r\n const validationForm = useMemo(() => {\r\n return { register, errors, clearError }\r\n }, [errors, register, clearError]\r\n );\r\n\r\n return (\r\n
    \r\n {showContrastToggle &&

    {language.payment_info.page_title}

    }\r\n \r\n \r\n \r\n \r\n { dispatch(setCurrentPage(pages.GIFT_CARD_INFORMATION)) }}\r\n />\r\n {\r\n dispatch(setCurrentPage(pages.AMOUNT_SELECTION));\r\n }}\r\n testRole=\"primary-button\"\r\n />\r\n \r\n }/>\r\n
    \r\n );\r\n}","import React from 'react'\r\nimport PageNavigation from '../../../components/PageNavigation'\r\nimport AmountSelectionField from '../../../components/AmountSelectionField'\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { giftCard, pages, reload, validationType } from \"../../../constants\";\r\nimport { setGiftCardInfo, setCurrentPage } from '../../../actions'\r\nimport { formatCurrency, removeNonNumeric } from '../../../utils'\r\nimport Button from '../../../components/Button';\r\nimport { useForm } from 'react-hook-form';\r\n\r\nexport default () => {\r\n const dispatch = useDispatch();\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const giftCardInfo = useSelector((state: any) => state.giftCard);\r\n const language = useSelector((state: any) => state.language);\r\n const { validation } = language.errors;\r\n const { minimumValue, maximumValue, defaultAmount, currencyCode, currencySign, denominationRange } =\r\n configuration.amount;\r\n const { languageCode } = configuration.language;\r\n const { amount_info } = language;\r\n const { amount } = amount_info;\r\n const { register, errors, clearError, setError } = useForm({ mode: \"onBlur\" });\r\n const { showContrastToggle } = configuration.storefront || false;\r\n\r\n const amountIsOverMax = (value: any) => {\r\n value = parseInt(removeNonNumeric(value));\r\n const balance = parseFloat(giftCardInfo[giftCard.cardBalance]);\r\n return value + balance > maximumValue;\r\n }\r\n\r\n const amountIsUnderMin = (value: any) => {\r\n value = parseInt(removeNonNumeric(value));\r\n return value < minimumValue;\r\n }\r\n\r\n const handleBlur = (event: React.ChangeEvent) => {\r\n if (amountIsUnderMin(event.target.value)) {\r\n setError(reload.amount, \"amountIsUnderMin\", validation.amount_under_min);\r\n dispatch(setGiftCardInfo({\r\n [giftCard.cardReloadAmount]: formatCurrency(minimumValue, languageCode, currencyCode)\r\n }));\r\n } else {\r\n clearError(reload.amount);\r\n }\r\n }\r\n\r\n const handleChange = (event: React.ChangeEvent) => {\r\n if (event){\r\n if (amountIsOverMax(event.target.value)) {\r\n setError(reload.amount, \"amountIsOverMax\", validation.exceeds_max_amount);\r\n return;\r\n } else {\r\n clearError(reload.amount);\r\n }\r\n\r\n if(amountIsUnderMin(event.target.value)) {\r\n setError(reload.amount, \"amountIsUnderMin\", validation.amount_under_min);\r\n dispatch(setGiftCardInfo({\r\n [giftCard.cardReloadAmount]: formatCurrency(minimumValue, languageCode, currencyCode)\r\n }));\r\n }\r\n\r\n dispatch(setGiftCardInfo({\r\n [giftCard.cardReloadAmount]: formatCurrency(event.target.value, languageCode, currencyCode)\r\n }));\r\n }\r\n }\r\n\r\n const handleFocus = (event: React.KeyboardEvent | React.MouseEvent | React.FocusEvent) =>{\r\n clearError();\r\n }\r\n\r\n const handleSelect = (event: React.KeyboardEvent | React.MouseEvent) => {\r\n const button = event.target as HTMLButtonElement;\r\n if (amountIsOverMax(button.value)) {\r\n return;\r\n };\r\n\r\n dispatch(setGiftCardInfo({\r\n [giftCard.cardReloadAmount]: formatCurrency(button.value, languageCode, currencyCode)\r\n }));\r\n\r\n clearError(reload.amount);\r\n }\r\n\r\n return (\r\n
    \r\n {showContrastToggle &&

    {amount_info.page_title}

    }\r\n

    {amount_info.gift_card_number} 999999219947821382262

    \r\n

    {amount.section_title} {currencySign}{formatCurrency(50,\r\n languageCode,\r\n currencyCode)} {currencyCode}

    \r\n

    {amount_info.maximum_amount} {currencySign}{formatCurrency(maximumValue, languageCode, currencyCode)\r\n } {currencyCode}

    \r\n
    \r\n {amount.legend_description}\r\n \r\n
    \r\n\r\n \r\n { dispatch(setCurrentPage(pages.PAYMENT_INFORMATION)) }}\r\n />\r\n {\r\n dispatch(setCurrentPage(pages.ORDER_SUMMARY));\r\n }}\r\n testRole=\"primary-button\"\r\n />\r\n \r\n }/>\r\n
    \r\n );\r\n}","import React, { useState } from 'react'\r\nimport PageNavigation from '../../../components/PageNavigation'\r\nimport Button from '../../../components/Button'\r\nimport { pages, terms, validationType, billing } from '../../../constants'\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { setCurrentPage, setBillingInfo } from '../../../actions'\r\nimport { getRegionLabel, getZipLabel, formatCurrency, getLastFourCharacters, getExpirationDate, useCurrencyPosition } from '../../../utils'\r\nimport CreditCardIssuer from '../../../components/CreditCardIssuer'\r\nimport Terms from '../../../components/Terms'\r\nimport { useForm } from 'react-hook-form'\r\nimport OptIn from '../../../components/OptIn'\r\n\r\nexport const OrderSummary = () => {\r\n const dispatch = useDispatch();\r\n const language = useSelector((state: any) => state.language);\r\n const billingInfo = useSelector((state: any) => state.billing);\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const [isOptInChecked, setOptInChecked] = useState(false);\r\n const { order_summary } = language;\r\n const { validation } = language.errors;\r\n const { gift_card, payment_info, billing_info } = order_summary.summary.fields;\r\n const { region, zip_postal } = language.payment_info.billing_info.fields;\r\n const [buyatabTermsChecked, setBuyatabTermsChecked] = useState(false);\r\n const [clientTermsChecked, setClientTermsChecked] = useState(false);\r\n const { buyatabLabel, storefrontLabel, shouldDisplayStoreFrontTerms, isCheckboxVisible, isCheckboxRequired } =\r\n configuration.termsAndConditions;\r\n const { register } = useForm({ mode: \"onChange\", submitFocusError: false });\r\n const { currencySign, currencyCode } = configuration.amount;\r\n const { languageCode } = language;\r\n const { isOptInEnabled, optInHtml } = configuration.storefront;\r\n\r\n const handleChange = (event: React.ChangeEvent) => {\r\n if (event.target.id === terms.buyatabTerms) {\r\n setBuyatabTermsChecked(!buyatabTermsChecked);\r\n } else {\r\n setClientTermsChecked(!clientTermsChecked);\r\n }\r\n }\r\n\r\n const handleOptIn = (event: React.ChangeEvent) => {\r\n const newValue = !isOptInChecked;\r\n setOptInChecked(newValue);\r\n dispatch(setBillingInfo({ [billing.optIn]: newValue }));\r\n }\r\n\r\n return (\r\n
    \r\n

    {order_summary.page_title}

    \r\n
    \r\n {order_summary.summary.legend_description}\r\n\r\n
    \r\n
    \r\n

    {gift_card.title}

    \r\n
    \r\n
    {gift_card.current_balance}
    \r\n \r\n {useCurrencyPosition(formatCurrency(50, languageCode, currencyCode), currencySign)}\r\n {currencyCode}\r\n \r\n
    \r\n
    \r\n
    {gift_card.reload_amount}
    \r\n \r\n {useCurrencyPosition(formatCurrency(250, languageCode, currencyCode), currencySign)}\r\n {currencyCode}\r\n \r\n
    \r\n
    \r\n
    {gift_card.new_balance}
    \r\n \r\n {currencySign}\r\n {useCurrencyPosition(formatCurrency(\r\n 300,\r\n languageCode,\r\n currencyCode), currencySign)}\r\n {currencyCode}\r\n \r\n
    \r\n
    \r\n\r\n
    \r\n

    {payment_info.title}

    \r\n
    \r\n
    \r\n\r\n {\r\n return billingInfo[billing.issuer];\r\n }}/>\r\n
    \r\n {payment_info.ending_in} {getLastFourCharacters(\"4000000000000002\")}\r\n
    \r\n
    \r\n
    {payment_info.expiry_date}
    \r\n {getExpirationDate(billingInfo[billing.expirationDate])}\r\n
    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n

    {billing_info.title}

    \r\n
    \r\n
    {billing_info.email_address}
    test@buyatab.com
    \r\n
    \r\n
    {billing_info.phone_number}
    +1 888-267-0447
    \r\n
    \r\n
    {billing_info.address}
    \r\n 788 Beatty St B1
    \r\n
    \r\n
    {billing_info.city}
    Vancouver
    \r\n
    \r\n
    {getRegionLabel(\"CAN\", region)}:
    British Columbia
    \r\n
    \r\n
    {billing_info.country}
    Canada
    \r\n
    \r\n
    {getZipLabel(\"CAN\", zip_postal)}:
    V6B 2M1
    \r\n
    \r\n
    \r\n\r\n
    \r\n \r\n \r\n\r\n {shouldDisplayStoreFrontTerms &&\r\n \r\n }\r\n
    \r\n
    \r\n\r\n \r\n { dispatch(setCurrentPage(pages.AMOUNT_SELECTION)) }}\r\n />\r\n { dispatch(setCurrentPage(pages.ORDER_CONFIRMATION)) }}\r\n testRole=\"primary-button\"\r\n />\r\n \r\n }/>\r\n
    \r\n );\r\n}\r\n\r\nexport default OrderSummary","import React from 'react'\r\nimport PageNavigation from '../../../components/PageNavigation'\r\nimport Button from '../../../components/Button'\r\nimport { useSelector, useDispatch } from 'react-redux'\r\nimport { setCurrentPage } from '../../../actions'\r\nimport { pages } from '../../../constants'\r\n\r\nexport default () => {\r\n const dispatch = useDispatch();\r\n const language = useSelector((state: any) => state.language);\r\n const { order_confirmation } = language;\r\n\r\n return (\r\n
    \r\n

    {order_confirmation.page_title}

    \r\n

    {order_confirmation.order_number} : 123456

    \r\n

    {order_confirmation.email} billingemail@buyatab.com

    \r\n \r\n \r\n {window.location.reload(false)}}\r\n testRole=\"primary-button\"\r\n /> \r\n { dispatch(setCurrentPage(pages.ERROR)) }}\r\n />\r\n }\r\n />\r\n
    \r\n )\r\n }\r\n ","import React from 'react'\r\nimport PageNavigation from '../../../components/PageNavigation'\r\nimport Button from '../../../components/Button'\r\nimport { useSelector } from 'react-redux'\r\n\r\nexport default () => {\r\n const language = useSelector((state: any) => state.language);\r\n return (\r\n <>\r\n

    {language.error_page.page_title}

    \r\n

    {language.error_page.page_body}

    \r\n \r\n {\r\n window.location.reload(false);\r\n }}\r\n testRole=\"primary-button\"\r\n /> \r\n \r\n }/>\r\n \r\n );\r\n}","import React from 'react'\r\nimport { GiftCardInformation, PaymentInformation, AmountSelection, OrderSummary, OrderConfirmation, Error } from \"../containers\"\r\nimport { pages } from '../constants'\r\n\r\nexport default ({page}) => {\r\n switch (page) {\r\n case pages.GIFT_CARD_INFORMATION:\r\n return()\r\n case pages.PAYMENT_INFORMATION:\r\n return()\r\n case pages.AMOUNT_SELECTION:\r\n return()\r\n case pages.ORDER_SUMMARY:\r\n return()\r\n case pages.ORDER_CONFIRMATION:\r\n return()\r\n case pages.ERROR:\r\n return()\r\n default:\r\n return()\r\n }\r\n}\r\n","import React from 'react'\r\nimport { GiftCardInformationPreview, PaymentInformationPreview, AmountSelectionPreview, OrderSummaryPreview, OrderConfirmationPreview, ErrorPreview } from \"../containers\"\r\nimport { pages } from '../constants'\r\n\r\nexport default ({page}) => {\r\n switch (page) {\r\n case pages.GIFT_CARD_INFORMATION:\r\n return ();\r\n case pages.PAYMENT_INFORMATION:\r\n return ();\r\n case pages.AMOUNT_SELECTION:\r\n return ();\r\n case pages.ORDER_SUMMARY:\r\n return ();\r\n case pages.ORDER_CONFIRMATION:\r\n return ();\r\n case pages.ERROR:\r\n return ();\r\n default:\r\n return ();\r\n }\r\n}\r\n","import React from 'react'\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { setContrastMode } from '../actions'\r\n\r\n\r\ninterface IHeader{\r\n buttonLabel?: string \r\n}\r\n\r\nconst Header = (props: IHeader) => {\r\n const dispatch = useDispatch()\r\n const settings = useSelector((state: any) => state.settings) \r\n let {accessibleToggle} = settings\r\n \r\n const toggleAccessibleMode = () => {\r\n dispatch(setContrastMode(!accessibleToggle))\r\n }\r\n \r\n return (\r\n
    \r\n \r\n
    \r\n )\r\n}\r\n\r\nHeader.defaultProps = {\r\n buttonLabel: \"Contrast Mode\"\r\n}\r\n\r\nexport default Header","import React from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport ContactUsSection from \"./ContactUsSection\";\r\n\r\nexport default () => {\r\n const configuration = useSelector((state: any) => state.configuration);\r\n const language = useSelector((state: any) => state.language);\r\n let { secureUrl } = configuration.externalLinks;\r\n\r\n return (\r\n
    \r\n

    \r\n \r\n {`${language.footer.secure_note[0]} ${language.footer.secure_note[1]}`}\r\n \r\n

    \r\n \r\n

    {language.footer.buyatab_rights}

    \r\n
    \r\n );\r\n};\r\n","import React, { useState, useEffect } from 'react'\r\n// import { GiftCardInformation, CreditCardInformation, AmountSelection, OrderSummary, OrderConfirmation } from \"./\"\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { getConfiguration, getPreviewConfiguration } from '../actions'\r\nimport { HollowDotsSpinner } from \"react-epic-spinners\"\r\nimport ErrorMessage from \"../components/ErrorMessage\";\r\nimport PageSelector from \"../components/PageSelector\"\r\nimport PreviewPageSelector from \"../components/PreviewPageSelector\"\r\nimport Header from \"../components/Header\"\r\nimport { isInIframe, isValidPageName, triggerResizeEvent } from \"../utils\"\r\nimport Footer from '../components/Footer';\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { pages } from '../constants';\r\nimport { getReturnUrl } from '../utils'\r\n\r\nconst App: React.FC = () => {\r\n const [loading, setLoading] = useState(true)\r\n const [error, setError] = useState(false)\r\n const settings = useSelector((state: any) => state.settings)\r\n const configuration = useSelector((state: any) => state.configuration)\r\n const language = useSelector((state: any) => state.language)\r\n const { showContrastToggle } = configuration.storefront || false\r\n const dispatch = useDispatch()\r\n const setPageHeight = () => {\r\n let body = document.body\r\n let html = document.documentElement\r\n let pageHeight = Math.max(body.scrollHeight,\r\n body.offsetHeight,\r\n html.clientHeight,\r\n html.scrollHeight,\r\n html.offsetHeight)\r\n triggerResizeEvent(pageHeight)\r\n }\r\n const observer = new MutationObserver(list => {\r\n const evt = new CustomEvent('dom-changed', { detail: list });\r\n document.body.dispatchEvent(evt)\r\n });\r\n observer.observe(document.body, { attributes: true, childList: true, subtree: true });\r\n window.addEventListener('resize', setPageHeight)\r\n document.body.addEventListener('dom-changed', setPageHeight);\r\n\r\n const isAbortIconVisible = configuration.reloadCardSession && settings.currentPage !== pages.ORDER_CONFIRMATION;\r\n \r\n // Reset local storage on App Load, only run once on mount and once on dismount.\r\n useEffect(() => {\r\n localStorage.removeItem(\"CcIssuer\")\r\n\r\n return () => {\r\n localStorage.removeItem(\"CcIssuer\")\r\n }\r\n }, [])\r\n\r\n const search = useLocation().search;\r\n const luid = new URLSearchParams(search).get('luid');\r\n const previewMode = new URLSearchParams(search).get('p');\r\n const version = new URLSearchParams(search).get('v');\r\n\r\n const headerContent = (
    \r\n

    {language.main_title}

    \r\n { isAbortIconVisible && }\r\n
    );\r\n\r\n useEffect(() => {\r\n if (previewMode && previewMode === \"1\" && luid && version) {\r\n dispatch(getPreviewConfiguration(luid, version,\r\n () => {\r\n const mainElement = document.getElementById('buyatabContent');\r\n mainElement!.classList.add(\"sd-no-iframe\");\r\n setError(false);\r\n setLoading(false);\r\n },\r\n () => {\r\n setError(true);\r\n setLoading(false);\r\n }));\r\n } else {\r\n dispatch(getConfiguration(() => { \r\n if (!isInIframe()) {\r\n const mainElement = document.getElementById('buyatabContent');\r\n mainElement!.classList.add(\"sd-no-iframe\");\r\n }\r\n setError(false);\r\n setLoading(false);\r\n },\r\n () => {\r\n setError(true);\r\n setLoading(false);\r\n }));\r\n }\r\n }, [dispatch, luid, previewMode, version]);\r\n\r\n if (loading) {\r\n return (\r\n );\r\n }\r\n\r\n if (error) {\r\n return (\r\n );\r\n }\r\n\r\n \r\n if (previewMode && previewMode === \"1\" && luid && version) {\r\n return (\r\n
    \r\n {showContrastToggle &&
    }\r\n
    \r\n {headerContent}\r\n \r\n
    \r\n
    \r\n
    \r\n );\r\n } else {\r\n return (\r\n
    \r\n {showContrastToggle &&
    }\r\n
    \r\n {headerContent}\r\n \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n\r\nexport default App","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(\r\n process.env.PUBLIC_URL,\r\n window.location.href\r\n );\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' }\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import { GET_CONFIGURATION, SET_TOKEN } from \"../actions\"\r\n\r\nlet initialState = { }\r\n\r\nexport default (state = initialState, {type, payload}) => {\r\n switch (type) {\r\n case GET_CONFIGURATION:\r\n return {...state, ...payload}\r\n case SET_TOKEN:\r\n return {...state, token : payload}\r\n default:\r\n return state\r\n }\r\n}\r\n","import { SET_CURRENT_PAGE, SET_CONTRAST_MODE, SET_URL_REFRRER } from \"../actions\";\r\nimport { pages } from \"../constants\";\r\n\r\nlet initialState = {\r\n currentPage: pages.GIFT_CARD_INFORMATION,\r\n accessibleToggle: false,\r\n urlReferrer: undefined\r\n};\r\n\r\nexport default (state = initialState, { type, payload }) => {\r\n switch (type) {\r\n case SET_CURRENT_PAGE:\r\n return { ...state, currentPage: payload };\r\n \r\n case SET_URL_REFRRER:\r\n return { ...state, urlReferrer: payload };\r\n\r\n case SET_CONTRAST_MODE:\r\n setHtmlClass(payload);\r\n return { ...state, accessibleToggle: payload };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst setHtmlClass = (accessible: boolean) => {\r\n const myHtml = document.getElementsByTagName(\"html\")[0];\r\n if (accessible) {\r\n myHtml.classList.add(\"accessible\");\r\n } else {\r\n myHtml.classList.remove(\"accessible\");\r\n }\r\n};\r\n","import { SET_BILLING_INFO, SET_CREDIT_CARD_SESSION} from \"../actions\"\r\nimport { billing, INVALID_OPTION } from \"../constants\"\r\n\r\nconst initialState = { \r\n valid: false,\r\n [billing.issuer]: null,\r\n [billing.number]: '',\r\n [billing.name]: '',\r\n [billing.expirationDate]: {'year': 0, 'month': 1},\r\n [billing.cvd]: '',\r\n [billing.address]: '',\r\n [billing.address2]: '',\r\n [billing.city]: '',\r\n [billing.country]: {'id': INVALID_OPTION, 'name': ''},\r\n [billing.region]: {'id': INVALID_OPTION, 'name': ''},\r\n [billing.zipCode]: '',\r\n [billing.phoneNumber]: '',\r\n [billing.email]: '',\r\n [billing.optIn]: false,\r\n [billing.paysafeSingleUseToken]: '',\r\n [billing.creditCardSession]: undefined\r\n\r\n}\r\n\r\nexport default (state = initialState, {type, payload}) => {\r\n switch (type) {\r\n case SET_BILLING_INFO: \r\n return { ...state, ...payload }\r\n case SET_CREDIT_CARD_SESSION:\r\n return {...state, [billing.creditCardSession]: payload}\r\n default:\r\n return state\r\n }\r\n}","import { GET_REGIONS } from \"../actions\";\r\n\r\nlet initialState = {\r\n regions:[]\r\n}\r\n\r\nexport default (state = initialState, {type, payload}) => {\r\n switch (type) {\r\n case GET_REGIONS:\r\n return payload\r\n \r\n default:\r\n return state\r\n }\r\n}\r\n","import { SET_GIFT_CARD_INFO } from '../actions'\r\nimport { giftCard } from \"../constants\"\r\n\r\nconst initialState = {\r\n valid: false,\r\n [giftCard.cardNumber]: '',\r\n [giftCard.cardPin]: '',\r\n [giftCard.recaptchaResponse]: '',\r\n [giftCard.cardBalance]: 0,\r\n [giftCard.cardReloadAmount]: 0,\r\n [giftCard.orderNumber]: 0,\r\n}\r\n\r\nexport default (state = initialState, { type, payload }) => {\r\n switch (type) {\r\n case SET_GIFT_CARD_INFO:\r\n return { ...state, ...payload }\r\n default:\r\n return state\r\n }\r\n}","import { SET_LANGUAGE } from '../actions'\r\n\r\nconst initialState = {}\r\n\r\nexport default (state = initialState, { type, payload }) => {\r\n switch (type) {\r\n case SET_LANGUAGE:\r\n return { ...state, ...payload }\r\n default:\r\n return state\r\n }\r\n}","import { combineReducers } from 'redux'\r\nimport configuration from './configuration.reducer'\r\nimport settings from \"./settings.reducer\"\r\nimport billing from \"./billing.reducer\"\r\nimport regions from \"./regions.reducer\"\r\nimport giftCard from \"./giftcard.reducer\"\r\nimport language from \"./language.reducer\";\r\n\r\nexport default combineReducers({\r\n configuration,\r\n settings,\r\n billing,\r\n regions,\r\n giftCard,\r\n language,\r\n})\r\n","import { applyMiddleware, createStore } from 'redux'\r\nimport rootReducer from '../reducers'\r\n// import logger from 'redux-logger'\r\nimport thunk from 'redux-thunk'\r\nimport { composeWithDevTools } from 'redux-devtools-extension'\r\n\r\nconst middleware = [ \r\n // logger, \r\n thunk,\r\n]\r\n\r\nexport default () => {\r\n\r\n if(process.env.NODE_ENV === \"development\"){\r\n return createStore(\r\n rootReducer,\r\n composeWithDevTools(\r\n applyMiddleware(...middleware)\r\n )\r\n )\r\n }\r\n\r\n return createStore( rootReducer, applyMiddleware(...middleware) )\r\n \r\n}","import 'react-app-polyfill/ie11'\r\nimport 'react-app-polyfill/stable'\r\nimport 'fast-text-encoding'\r\nimport React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport App from './containers/App'\r\nimport * as serviceWorker from './serviceWorker'\r\nimport { Provider } from 'react-redux'\r\nimport Store from './store'\r\nimport { Router } from 'react-router-dom';\r\nimport { createBrowserHistory } from 'history';\r\n\r\nconst history = createBrowserHistory();\r\n\r\nlet store = Store()\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n , document.getElementById('buyatabContent')\r\n )\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister()\r\n"],"sourceRoot":""}