{"version":3,"sources":["actions/sale.ts","selectors/currentSaleData.ts","utils/saleUtils.ts","api/shop.ts"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","return","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","catch","delegateYield","fetchSale","hasPreviousSale","arguments","undefined","_ref","_asyncToGenerator","_callee","dispatch","getState","_state$sale","state","cachedSaleData","discountedPricing","saleData","bundleDiscountObj","bundlePlanDiscounts","_discountedPricing","_context","sale","setSaleData","setSaleUI","showSalesLoader","getDiscountedPlanPricing","discountedCost","setSaleWorkState","WorkState","None","Loading","getSaleData","discountInfo","BBBundle","Log","error","join","_defineProperty","PlanType","Bundle","resetSaleState","saleJustEnded","t0","showError","message","_x","_x2","apply","fetchHouseAdCampaign","placement","_ref2","_callee2","houseAdCampaign","_context2","getHouseAdCampaign","setHouseAdCampaignHomepage","setHouseAdCampaignPricing","setHouseAdCampaignStripe","concat","_x3","_ref3","_callee3","_context3","trace","sessionStorage","removeItem","window","history","replaceState","location","pathname","actions","RESET_SALE_STATE","_x4","saleState","SET_SALE_STATE","SET_SALE_DATA","showSaleUI","SET_SALE_UI","SET_SALE_LOADER","SET_DISCOUNTED_COST","setTotalDiscountedCost","totalCost","SET_TOTAL_COST","SET_SALE_JUST_ENDED","SET_HOUSE_AD_CAMPAIGN_HOMEPAGE","SET_HOUSE_AD_CAMPAIGN_PRICING","SET_HOUSE_AD_CAMPAIGN_STRIPE","getCurrentHouseAdCampaignSelector","process","REACT_APP_HARDCODED_BANNERS","jsonString","obj","JSON","parse","id","description","Date","startDate","endDate","assets","console","getCampaignFromJsonString","campaign","calculateStripeTotal","cost","quantity","couponInfo","percentOff","paymentAmount","Math","round","currentUrl","urlQuery","promoCode","response","URL","toString","QueryString","search","getItem","setItem","fetchSaleData","_getHouseAdCampaign","_response$metadata","payload","result","API","get","metadata","status","Array","isArray","_objectSpread","discountedPlans","stringify","PLANS_JSON","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray","key","monthlyCost","parseCost","annualCost","yearCommitmentCost","originalCost","parseFloat","fixedCost","amountOff","getPlanDiscountInfo","item","productType","ProductType","BB2","BB3","BB4","Soundbox","warn","itemSubId","planType","Free","fetchXsollaCheckoutUrlForSkuOfType","xsollaSku","xsollaProductId","purchaseType","userEmail","reject","deviceType","isMobileOnly","purchaseParams","encodeURIComponent","headers","res","data","log","saleId","errorcode","code"],"mappings":";yRACAA,EAAA,kBAAAC,GAAA,IAAAC,EAAAD,EAAA,GAAAE,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAK,gBAAA,SAAAP,EAAAD,EAAAE,GAAAD,EAAAD,GAAAE,EAAAO,OAAAC,EAAA,mBAAAC,cAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAjB,EAAAD,EAAAE,GAAA,OAAAC,OAAAK,eAAAP,EAAAD,EAAA,CAAAS,MAAAP,EAAAiB,YAAA,EAAAC,cAAA,EAAAC,UAAA,IAAApB,EAAAD,GAAA,IAAAkB,EAAA,aAAAjB,GAAAiB,EAAA,SAAAjB,EAAAD,EAAAE,GAAA,OAAAD,EAAAD,GAAAE,GAAA,SAAAoB,E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ACrCkE,QAAQ2E,IAAI,iCAAkC7I,EAAMgF,UAMpDd,QAAQ2E,IAAI,gCAAiC7I,GAEzCA,EAAMgF,UAAYhF,EAAMgF,SAAS4D,KACnCP,EAAOrI,EAAMgF,SAAS4D,KAAK5I,OAE3BqI,EACE,IAAItN,MAAM,yCAA0CiF,EAAMgJ","file":"static/js/0.1caca30d.chunk.js","sourcesContent":["import { showError } from \"./error\";\nimport { DefaultThunkAction } from \"./shared\";\nimport { AnyAction } from \"redux\";\nimport { PlanType, WorkState } from \"../reducers/models\";\nimport actions from \"../constants/actions.json\";\nimport { getHouseAdCampaign, getSaleData } from \"../utils/saleUtils\";\nimport Log from \"../../src/utils/Log\";\nimport { getDiscountedPlanPricing } from \"../utils/saleUtils\";\n\n// gets called in /plans and /purchase to check for any active sales (404 means no sale)\nexport function fetchSale(\n hasPreviousSale: boolean = false\n): DefaultThunkAction> {\n return async (dispatch, getState) => {\n const state = getState();\n const cachedSaleData = state.sale?.saleData; // Assuming you have this in your Redux state\n //const cachedSaleData = useSelector(currentSaleData);\n\n // If sale data already exists, avoid calling the API\n if (cachedSaleData && Object.keys(cachedSaleData).length > 0) {\n await dispatch(setSaleData(cachedSaleData));\n dispatch(setSaleUI(true));\n dispatch(showSalesLoader(false));\n const discountedPricing = await getDiscountedPlanPricing();\n await dispatch(discountedCost(discountedPricing));\n dispatch(setSaleWorkState(WorkState.None));\n return;\n }\n\n dispatch(setSaleWorkState(WorkState.Loading));\n dispatch(showSalesLoader(true));\n\n try {\n let saleData: bb.model.sale.ISaleData|null = await getSaleData();\n\n if (saleData) {\n\n // we are treating bundle plans as special case for now\n // this chunk of code just looks for a single bundle-plan discount info\n // and renames it to \"Bundle\" if found\n const bundleDiscountObj = saleData.discountInfo.BBBundle\n if (bundleDiscountObj !== undefined) {\n const bundlePlanDiscounts = Object.values(bundleDiscountObj)\n if (bundlePlanDiscounts.length > 1) {\n Log.error(`multiple bundle plan discounts found! We only know how to deal with one kind of bundle plan right now!`)\n Log.error(Object.keys(bundleDiscountObj).join(\",\"))\n throw new Error(\"Unable to process sale info.\")\n }\n saleData.discountInfo.BBBundle = {[PlanType.Bundle]: bundlePlanDiscounts[0]}\n }\n await dispatch(setSaleData(saleData));\n dispatch(setSaleUI(true));\n dispatch(showSalesLoader(false));\n\n const discountedPricing = await getDiscountedPlanPricing();\n\n await dispatch(discountedCost(discountedPricing));\n } else {\n dispatch(resetSaleState());\n\n if (hasPreviousSale) {\n dispatch(saleJustEnded(true));\n }\n }\n\n dispatch(setSaleWorkState(WorkState.None));\n } catch (e:any) {\n //displays a non-404 error as a toast\n Log.error(\"fetchSale dispatch error\", e);\n dispatch(showError(e.message));\n dispatch(showSalesLoader(false));\n dispatch(resetSaleState());\n dispatch(setSaleWorkState(WorkState.Error));\n }\n };\n}\n\nexport function fetchHouseAdCampaign(placement: keyof bb.state.ISale[\"houseAdCampaign\"]): DefaultThunkAction> {\n return async function (dispatch) {\n const houseAdCampaign = await getHouseAdCampaign(placement)\n\n // FUTURE OPTIMIZATION: the SET function could maybe be generalized to do this check for us - or a lookup table used\n if (placement === \"website_homepage\") {\n dispatch(setHouseAdCampaignHomepage(houseAdCampaign))\n }\n else if (placement === \"website_pricing\") {\n dispatch(setHouseAdCampaignPricing(houseAdCampaign))\n }\n else if (placement === \"website_stripe\") {\n dispatch(setHouseAdCampaignStripe(houseAdCampaign))\n }\n else {\n Log.error(`something is broken! after fetching house ad campaign - unknown placement key not caught by tsc-compiler: ${placement}`)\n // silently fail aside from the error log above - not important enough to cause issues elsewhere in the site.\n }\n }\n}\n\nexport function resetSaleState(): DefaultThunkAction> {\n return async (dispatch) => {\n Log.trace(\"\", \"clearing sale state\");\n sessionStorage.removeItem(\"promoCode\");\n window.history.replaceState(null, window.location.pathname);\n\n dispatch(clearSaleState());\n };\n}\n\nexport function setSaleWorkState(saleState: WorkState): AnyAction {\n return {\n type: actions.sale.SET_SALE_STATE,\n saleState,\n };\n}\n\nexport function setSaleData(saleData: bb.model.sale.ISaleData): AnyAction {\n return {\n type: actions.sale.SET_SALE_DATA,\n saleData,\n };\n}\n\nexport function setSaleUI(showSaleUI: boolean): AnyAction {\n return {\n type: actions.sale.SET_SALE_UI,\n showSaleUI,\n };\n}\n\nexport function showSalesLoader(showSalesLoader: boolean): AnyAction {\n return {\n type: actions.sale.SET_SALE_LOADER,\n showSalesLoader,\n };\n}\n\nexport function discountedCost(discountedCost: bb.model.PlanJSON): AnyAction {\n return {\n type: actions.sale.SET_DISCOUNTED_COST,\n discountedCost,\n };\n}\n\nexport function setTotalDiscountedCost(totalCost: number): AnyAction {\n return {\n type: actions.sale.SET_TOTAL_COST,\n totalCost,\n };\n}\n\nexport function saleJustEnded(saleJustEnded: boolean): AnyAction {\n return {\n type: actions.sale.SET_SALE_JUST_ENDED,\n saleJustEnded,\n };\n}\n\nexport function clearSaleState(): AnyAction {\n return {\n type: actions.sale.RESET_SALE_STATE,\n };\n}\n\nexport function clearSaleData(): AnyAction {\n return {\n type: actions.sale.CLEAR_SALE_DATA,\n };\n}\n\nexport function setHouseAdCampaignHomepage(houseAdCampaign: bb.model.sale.IHouseAdCampaign|null): AnyAction {\n return {\n type: actions.sale.SET_HOUSE_AD_CAMPAIGN_HOMEPAGE,\n houseAdCampaign\n }\n}\nexport function setHouseAdCampaignPricing(houseAdCampaign: bb.model.sale.IHouseAdCampaign|null): AnyAction {\n return {\n type: actions.sale.SET_HOUSE_AD_CAMPAIGN_PRICING,\n houseAdCampaign\n }\n}\nexport function setHouseAdCampaignStripe(houseAdCampaign: bb.model.sale.IHouseAdCampaign|null): AnyAction {\n return {\n type: actions.sale.SET_HOUSE_AD_CAMPAIGN_STRIPE,\n houseAdCampaign\n }\n}\n","export default (state: { sale: { saleData: bb.model.sale.ISaleData } }) => {\n return state.sale.saleData;\n};\n\n\n\nfunction getCampaignFromJsonString(jsonString:string):bb.model.sale.IHouseAdCampaign|null {\n try {\n const obj = JSON.parse(jsonString)\n const campaign:bb.model.sale.IHouseAdCampaign = {\n \"id\": obj.id,\n \"name\": obj.name,\n \"description\": obj.description,\n \"startDate\": new Date(obj.startDate),\n \"endDate\": new Date(obj.endDate),\n \"assets\": obj.assets\n }\n return campaign\n }\n catch (e:any) {\n console.error(\"Error parsing campaign JSON string: \", e.message)\n return null\n }\n}\n\nexport function getCurrentHouseAdCampaignSelector(\n placement: keyof bb.state.ISale['houseAdCampaign']\n): (state: { sale: bb.state.ISale }) => bb.model.sale.IHouseAdCampaign | null {\n return (state: { sale: bb.state.ISale }) => {\n\n if(process.env.REACT_APP_HARDCODED_BANNERS) {\n return getCampaignFromJsonString(process.env.REACT_APP_HARDCODED_BANNERS)\n }\n\n const campaign = state.sale.houseAdCampaign[placement];\n if (campaign) {\n return campaign;\n }\n\n return null;\n };\n}\n","import QueryString from \"query-string\";\nimport { PlanType, ProductType } from \"../reducers/models\";\nimport Log from \"./Log\";\nimport { fetchSaleData } from \"../api/shop\";\nimport PLANS_JSON from \"../constants/planMetadata\";\n//import { API } from \"aws-amplify\";\nimport API from \"@aws-amplify/api\";\n\nexport const calculateStripeTotal = (\n cost: number,\n quantity: number,\n couponInfo?: bb.model.sale.ICouponData\n) => {\n // for Stripe\n if (couponInfo?.percentOff) {\n const percentDiscount = (100 - couponInfo.percentOff) / 100;\n\n // calculate the full bill\n let invoiceTotal = cost * quantity * 100;\n // apply coupon\n let paymentAmount = invoiceTotal * percentDiscount;\n // subtract a tiny fraction because stripe rounds 0.5 down for customers\n paymentAmount -= 0.001;\n // round again because we might have fractions of cents\n paymentAmount = Math.round(paymentAmount);\n\n return paymentAmount / 100;\n }\n};\n\nexport const getSaleData = async () => {\n //if window url contains a coupon code\n const currentUrl = new URL(window.location.toString());\n const urlQuery = QueryString.parse(currentUrl.search);\n let promoCode =\n typeof urlQuery[\"promo\"] === \"string\"\n ? urlQuery[\"promo\"]\n : sessionStorage.getItem(\"promoCode\");\n\n if (promoCode != null) {\n Log.trace(promoCode, \"promo code found:\");\n\n sessionStorage.setItem(\"promoCode\", promoCode);\n } else {\n sessionStorage.removeItem(\"promoCode\");\n }\n\n try {\n let response = await fetchSaleData(promoCode || null);\n return response;\n } catch (error:any) {\n throw new Error(error);\n }\n};\n\nexport async function getHouseAdCampaign(placement: (keyof bb.state.ISale[\"houseAdCampaign\"])):Promise {\n try {\n const response = await API.get(\"userAccountManagementURL\", `/marketing/placement/${placement}`, {})\n const payload = response.payload\n let result:bb.model.sale.IHouseAdCampaign|null = null\n if (response.metadata?.status !== \"SUCCESS\") {\n console.error(\"Unexpected response status from house-ad-campaign fetch: \", response.metadata)\n result = null\n }\n else if (payload === undefined) {\n console.error(\"Unexpected response format from house-ad-campaign fetch: \", response)\n result = null\n }\n else if (Array.isArray(payload)) {\n // no active campaign\n result = null\n }\n else {\n result = {\n ...payload,\n startDate: new Date(Date.parse(payload.startDate)),\n endDate: new Date(Date.parse(payload.endDate)),\n }\n }\n return result\n }\n catch (e:any) {\n console.error(\"Got error while fetching house-ad-campaign: \", e.message)\n return null\n }\n}\n\n\nexport const getDiscountedPlanPricing = (\n discountInfo?: bb.model.sale.ICouponData\n) => {\n let discountedPlans = JSON.parse(JSON.stringify(PLANS_JSON));\n\n for (const [key, value] of Object.entries(PLANS_JSON)) {\n if (discountedPlans[key].name !== \"Free\") {\n discountedPlans[key].name = key;\n discountedPlans[key].monthlyCost = parseCost(\n value.monthlyCost,\n discountInfo\n );\n discountedPlans[key].annualCost = parseCost(\n value.annualCost,\n discountInfo\n );\n discountedPlans[key].yearCommitmentCost = parseCost(\n value.yearCommitmentCost,\n discountInfo\n );\n }\n }\n return discountedPlans;\n};\n\nexport const parseCost = (cost: any, couponInfo?: bb.model.sale.ICouponData) => {\n const originalCost = parseFloat(cost);\n\n let fixedCost = cost;\n\n if (couponInfo?.percentOff) {\n // apply the discount percentage - since this is cost per unit, we pass in 1 for quantity\n fixedCost = calculateStripeTotal(cost, 1, couponInfo);\n } else if (couponInfo?.amountOff) {\n const difference = originalCost - couponInfo.amountOff;\n fixedCost = difference;\n }\n\n return fixedCost;\n};\n\n/**\n * Returns true if the given cart item's plan is on sale\n * given the passed in saleData\n * @param {bb.model.ISubscription} item\n * @param {bb.model.sale.ISaleData} saleData\n */\nexport function getPlanDiscountInfo(\n item: bb.model.ISubscription,\n saleData: bb.model.sale.ISaleData\n): bb.model.sale.ICouponData | null {\n if (saleData.discountInfo === undefined) {\n return null;\n }\n let discountInfo: bb.model.sale.IPlanTypes | undefined;\n if (item.productType === ProductType.BB2) {\n discountInfo = saleData.discountInfo.BB2;\n } \n else if (item.productType === ProductType.BB3) {\n discountInfo = saleData.discountInfo.BB3;\n }\n else if (item.productType === ProductType.BB4) {\n discountInfo = saleData.discountInfo.BB4;\n } \n else if (item.productType === ProductType.BBBundle) {\n discountInfo = saleData.discountInfo.BBBundle\n }\n else if (item.productType === ProductType.Soundbox) {\n discountInfo = saleData.discountInfo.Soundbox\n }\n else {\n console.warn(\"no discount system for unknown product \", item.productType)\n }\n\n const itemSubId = item.planType // i.e. BB2Plus => Plus\n if (itemSubId === PlanType.Free) {\n return null\n }\n\n return discountInfo !== undefined && itemSubId in discountInfo\n ? (discountInfo[itemSubId] as bb.model.sale.ICouponData)\n : null;\n}\n\nexport function annualToMonthlyCost(annualCost: string | number): number {\n return parseInt(\"\" + Math.ceil(parseFloat(\"\" + annualCost) / 12), 10);\n}\n","import API from \"@aws-amplify/api\";\nimport { isMobileOnly } from \"react-device-detect\";\n\n/**\n * get a xsolla checkout url for a given sku\n */\nexport const fetchXsollaCheckoutUrlForSkuOfType = (\n xsollaSku:any,\n xsollaProductId:any,\n purchaseType:any,\n // userAccessToken:any,\n userEmail: string\n):Promise => {\n return new Promise((resolve, reject) => {\n let deviceType = \"desktop\";\n if (isMobileOnly) {\n deviceType = \"mobile\";\n }\n let purchaseParams =\n \"/assetmanagement/accountless/checkouturl?sku=\" +\n xsollaSku +\n \"&purchaseType=\" +\n purchaseType +\n \"&deviceType=\" +\n deviceType +\n \"&webhook=true\" +\n \"&userEmail=\" +\n `${encodeURIComponent(userEmail)}`;\n if (xsollaProductId) {\n purchaseParams += \"&productId=\" + xsollaProductId;\n }\n if (process.env.REACT_APP_XSOLLA_ENV !== \"production\") {\n purchaseParams += \"&sandbox=true\";\n }\n //console.log(\"generating xsolla token with \", purchaseParams);\n API.get(\"assetsURL\", purchaseParams, {\n headers: {\n \"Content-Type\": \"application/json\",\n // Token: userAccessToken,\n },\n response: true,\n })\n .then((res) => {\n //console.log(\"got xsolla checkout url response: \", res);\n if (res.status === 200 || res.status === 201) {\n resolve(res.data);\n } else {\n reject(\n new Error(\"Unexpected response from server, code=\"+ res.status)\n );\n }\n })\n .catch((error) => {\n console.log(\"error trying to get xsolla checkout url: \", error);\n if (error.response.status >= 400 && error.response.status <= 499) {\n reject(error.response);\n }\n if (error.response) {\n reject(error.response.data.error);\n } else {\n reject(new Error(\"Unexpected response from server: \"+ error));\n }\n });\n });\n};\n\nexport const fetchSaleData = (saleId:any):Promise => {\n return new Promise((resolve, reject) => {\n const URL = saleId ? `/sales/${saleId}` : \"/sales\";\n\n API.get(\"userAccountManagementURL\", URL, {\n headers: {\n \"Content-Type\": \"application/json\",\n },\n response: true,\n })\n .then((res) => {\n if (res.status === 200 || res.status === 201) {\n // console.log(res.data.payload);\n if (res.data.metadata.errorcode === \"ENTITY_NOT_FOUND\") {\n // no active sale\n resolve(null);\n } else {\n resolve(res.data.payload);\n }\n } else {\n reject(\n new Error(\n \"Unexpected response from server, please try again later.\"\n )\n );\n }\n })\n .catch((error) => {\n console.log(\"fetchSaleData error: \", error);\n console.log(\"fetchSaleData error.response? \", error.response);\n // switched to a 200 + error message response for no-active-sale\n // if (error && error.response && error.response.status === 404) {\n // console.log(\"no sale right now\");\n // return resolve(null);\n // }\n console.log(\"fetchSaleData non-404 error: \", error);\n\n if (error.response && error.response.data) {\n reject(error.response.data.error);\n } else {\n reject(\n new Error(\"Unexpected response from server, code=\"+ error.code)\n );\n }\n });\n });\n};\n"],"sourceRoot":""}