{"version":3,"sources":["redux/actions/wishlistActions.js","redux/actions/compareActions.js","lib/contextLib.js","redux/actions/currencyActions.js","redux/reducers/currencyReducer.js","redux/reducers/productReducer.js","redux/actions/productActions.js","redux/reducers/cartReducer.js","redux/reducers/wishlistReducer.js","redux/reducers/compareReducer.js","redux/reducers/rootReducer.js","helpers/scroll-top.js","App.js","serviceWorker.js","index.js","redux/actions/cartActions.js"],"names":["ADD_TO_WISHLIST","DELETE_FROM_WISHLIST","DELETE_ALL_FROM_WISHLIST","addToWishlist","item","addToast","dispatch","appearance","autoDismiss","type","payload","ADD_TO_COMPARE","DELETE_FROM_COMPARE","addToCompare","AppContext","createContext","useAppContext","useContext","SET_CURRENCY","setCurrency","currencyName","axios","get","then","response","rates","data","currencyRate","rate","catch","err","console","log","initState","currencySymbol","currencyReducer","state","action","products","productReducer","cartReducer","cartItems","product","ADD_TO_CART","undefined","variation","cartItem","filter","id","quantity","cartItemId","uuid","map","selectedProductColor","selectedProductSize","DECREASE_QUANTITY","remainingItems","DELETE_FROM_CART","DELETE_ALL_FROM_CART","wishlistReducer","wishlistItems","wishlistItem","compareReducer","compareItems","compareItem","rootReducer","combineReducers","multilanguage","createMultilanguageReducer","currentLanguageCode","currencyData","productData","cartData","wishlistData","compareData","withRouter","props","useEffect","window","scrollTo","children","HomeIndex","lazy","MiCuenta","Catalogo","Product","ProductTabLeft","About","Nosotros","Contact","Videos","Cursos","Eventos","NotFound","PagoAprobado","Politicas","Login","Registro","Recuperar","helmetContext","connect","useState","isAuthenticated","userHasAuthenticated","objUser","setObjUser","loadLanguages","languages","en","require","es","context","Provider","value","placement","fallback","className","exact","path","component","render","routeProps","key","match","params","code","Boolean","location","hostname","store","createStore","load","composeWithDevTools","applyMiddleware","thunk","save","fetchProductsSuccess","fetchProducts","ReactDOM","document","getElementById","navigator","serviceWorker","ready","registration","unregister","addToCart","quantityCount","deleteFromCart"],"mappings":"kHAAA,wIAAO,IAAMA,EAAkB,kBAClBC,EAAuB,uBACvBC,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kBAAC,WAAD,CAAUS,MAAOA,IACf,kBAAC,GAAD,OAEFU,SAASC,eAAe,SDmGpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMxH,MAAK,SAAAyH,GACjCA,EAAaC,iB,wPEnINtG,EAAc,cACdY,EAAoB,oBACpBE,EAAmB,mBACnBC,EAAuB,uBAGvBwF,EAAY,SACvB9I,EACAC,EACA8I,EACA9F,EACAC,GAEA,OAAO,SAAAhD,GACDD,GACFA,EAAS,gBAAiB,CAAEE,WAAY,UAAWC,aAAa,IAElEF,EAAS,CACPG,KAAMkC,EACNjC,QAAQ,2BACHN,GADE,IAEL6C,SAAUkG,EACV9F,qBAAsBA,IAElBjD,EAAKiD,qBACLjD,EAAKiD,qBACL,MACJC,oBAAqBA,IAEjBlD,EAAKkD,oBACLlD,EAAKkD,oBACL,YAkBC8F,EAAiB,SAAChJ,EAAMC,GACnC,OAAO,SAAAC,GACDD,GACFA,EAAS,oBAAqB,CAAEE,WAAY,QAASC,aAAa,IAEpEF,EAAS,CAAEG,KAAMgD,EAAkB/C,QAASN,Q","file":"static/js/main.4ad7e861.chunk.js","sourcesContent":["export const ADD_TO_WISHLIST = \"ADD_TO_WISHLIST\";\nexport const DELETE_FROM_WISHLIST = \"DELETE_FROM_WISHLIST\";\nexport const DELETE_ALL_FROM_WISHLIST = \"DELETE_ALL_FROM_WISHLIST\";\n\n// add to wishlist\nexport const addToWishlist = (item, addToast) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Added To Wishlist\", {\n appearance: \"success\",\n autoDismiss: true\n });\n }\n dispatch({ type: ADD_TO_WISHLIST, payload: item });\n };\n};\n\n// delete from wishlist\nexport const deleteFromWishlist = (item, addToast) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Removed From Wishlist\", {\n appearance: \"error\",\n autoDismiss: true\n });\n }\n dispatch({ type: DELETE_FROM_WISHLIST, payload: item });\n };\n};\n\n//delete all from wishlist\nexport const deleteAllFromWishlist = addToast => {\n return dispatch => {\n if (addToast) {\n addToast(\"Removed All From Wishlist\", {\n appearance: \"error\",\n autoDismiss: true\n });\n }\n dispatch({ type: DELETE_ALL_FROM_WISHLIST });\n };\n};\n","export const ADD_TO_COMPARE = \"ADD_TO_COMPARE\";\nexport const DELETE_FROM_COMPARE = \"DELETE_FROM_COMPARE\";\n\n// add to compare\nexport const addToCompare = (item, addToast) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Added To Compare\", {\n appearance: \"success\",\n autoDismiss: true\n });\n }\n dispatch({ type: ADD_TO_COMPARE, payload: item });\n };\n};\n\n// delete from compare\nexport const deleteFromCompare = (item, addToast) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Removed From Compare\", {\n appearance: \"error\",\n autoDismiss: true\n });\n }\n dispatch({ type: DELETE_FROM_COMPARE, payload: item });\n };\n};\n","import { useContext, createContext } from \"react\";\n\nexport const AppContext = createContext(null);\n\nexport function useAppContext() {\n return useContext(AppContext);\n}","import axios from \"axios\";\nexport const SET_CURRENCY = \"SET_CURRENCY\";\n\nexport const setCurrency = (currencyName) => {\n return (dispatch) => {\n axios\n .get(\n `https://api.exchangeratesapi.io/v1/latest?access_key=9556740786a264326a029a434e1fcd95&base=MXN&symbols=USD,MXN,CAD,EUR`\n )\n .then((response) => {\n const rates = response.data.rates;\n let currencyRate = 0;\n for (const rate in rates) {\n if (rate === currencyName) {\n currencyRate = rates[rate];\n }\n }\n dispatch({\n type: SET_CURRENCY,\n payload: { currencyName, currencyRate }\n });\n })\n .catch((err) => {\n console.log(\"Error: \", err);\n });\n };\n};\n","import { SET_CURRENCY } from \"../actions/currencyActions\";\n\nconst initState = {\n currencySymbol: \"$\",\n currencyName: \"MXN\",\n currencyRate: 1\n};\n\nconst currencyReducer = (state = initState, action) => {\n if (action.type === SET_CURRENCY) {\n const currencyName = action.payload.currencyName;\n if (currencyName === \"USD\") {\n return {\n ...state,\n currencySymbol: \"USD $\",\n currencyRate: action.payload.currencyRate,\n currencyName: action.payload.currencyName\n };\n }\n if (currencyName === \"MXN\") {\n console.log('MXN');\n return {\n ...state,\n currencySymbol: \"MXN $\",\n currencyRate: action.payload.currencyRate,\n currencyName: action.payload.currencyName\n };\n }\n if (currencyName === \"CAD\") {\n return {\n ...state,\n currencySymbol: \"CAD $\",\n currencyRate: action.payload.currencyRate,\n currencyName: action.payload.currencyName\n };\n } \n if (currencyName === \"EUR\") {\n return {\n ...state,\n currencySymbol: \"EUR $\",\n currencyRate: action.payload.currencyRate,\n currencyName: action.payload.currencyName\n };\n } \n }\n\n return state;\n};\n\nexport default currencyReducer;\n","import { FETCH_PRODUCTS_SUCCESS } from \"../actions/productActions\";\n\nconst initState = {\n products: []\n};\n\nconst productReducer = (state = initState, action) => {\n if (action.type === FETCH_PRODUCTS_SUCCESS) {\n return {\n ...state,\n products: action.payload\n };\n }\n\n return state;\n};\n\nexport default productReducer;\n","export const FETCH_PRODUCTS_SUCCESS = \"FETCH_PRODUCTS_SUCCESS\";\n\nconst fetchProductsSuccess = products => ({\n type: FETCH_PRODUCTS_SUCCESS,\n payload: products\n});\n\n// fetch products\nexport const fetchProducts = products => {\n return dispatch => {\n dispatch(fetchProductsSuccess(products));\n };\n};\n","import uuid from \"uuid/v4\";\nimport {\n ADD_TO_CART,\n DECREASE_QUANTITY,\n DELETE_FROM_CART,\n DELETE_ALL_FROM_CART\n} from \"../actions/cartActions\";\n\nconst initState = [];\n\nconst cartReducer = (state = initState, action) => {\n const cartItems = state,\n product = action.payload;\n\n if (action.type === ADD_TO_CART) {\n // for non variant products\n if (product.variation === undefined) {\n const cartItem = cartItems.filter(item => item.id === product.id)[0];\n if (cartItem === undefined) {\n return [\n ...cartItems,\n {\n ...product,\n quantity: product.quantity ? product.quantity : 1,\n cartItemId: uuid()\n }\n ];\n } else {\n return cartItems.map(item =>\n item.cartItemId === cartItem.cartItemId\n ? {\n ...item,\n quantity: product.quantity\n ? item.quantity + product.quantity\n : item.quantity + 1\n }\n : item\n );\n }\n // for variant products\n } else {\n const cartItem = cartItems.filter(\n item =>\n item.id === product.id &&\n product.selectedProductColor &&\n product.selectedProductColor === item.selectedProductColor &&\n product.selectedProductSize &&\n product.selectedProductSize === item.selectedProductSize &&\n (product.cartItemId ? product.cartItemId === item.cartItemId : true)\n )[0];\n\n if (cartItem === undefined) {\n return [\n ...cartItems,\n {\n ...product,\n quantity: product.quantity ? product.quantity : 1,\n cartItemId: uuid()\n }\n ];\n } else if (\n cartItem !== undefined &&\n (cartItem.selectedProductColor !== product.selectedProductColor ||\n cartItem.selectedProductSize !== product.selectedProductSize)\n ) {\n return [\n ...cartItems,\n {\n ...product,\n quantity: product.quantity ? product.quantity : 1,\n cartItemId: uuid()\n }\n ];\n } else {\n return cartItems.map(item =>\n item.cartItemId === cartItem.cartItemId\n ? {\n ...item,\n quantity: product.quantity\n ? item.quantity + product.quantity\n : item.quantity + 1,\n selectedProductColor: product.selectedProductColor,\n selectedProductSize: product.selectedProductSize\n }\n : item\n );\n }\n }\n }\n\n if (action.type === DECREASE_QUANTITY) {\n if (product.quantity === 1) {\n const remainingItems = (cartItems, product) =>\n cartItems.filter(\n cartItem => cartItem.cartItemId !== product.cartItemId\n );\n return remainingItems(cartItems, product);\n } else {\n return cartItems.map(item =>\n item.cartItemId === product.cartItemId\n ? { ...item, quantity: item.quantity - 1 }\n : item\n );\n }\n }\n\n if (action.type === DELETE_FROM_CART) {\n const remainingItems = (cartItems, product) =>\n cartItems.filter(cartItem => cartItem.cartItemId !== product.cartItemId);\n return remainingItems(cartItems, product);\n }\n\n if (action.type === DELETE_ALL_FROM_CART) {\n return cartItems.filter(item => {\n return false;\n });\n }\n\n return state;\n};\n\nexport default cartReducer;\n","import {\n ADD_TO_WISHLIST,\n DELETE_FROM_WISHLIST,\n DELETE_ALL_FROM_WISHLIST\n} from \"../actions/wishlistActions\";\n\nconst initState = [];\n\nconst wishlistReducer = (state = initState, action) => {\n const wishlistItems = state,\n product = action.payload;\n\n if (action.type === ADD_TO_WISHLIST) {\n const wishlistItem = wishlistItems.filter(\n item => item.id === product.id\n )[0];\n if (wishlistItem === undefined) {\n return [...wishlistItems, product];\n } else {\n return wishlistItems;\n }\n }\n\n if (action.type === DELETE_FROM_WISHLIST) {\n const remainingItems = (wishlistItems, product) =>\n wishlistItems.filter(wishlistItem => wishlistItem.id !== product.id);\n return remainingItems(wishlistItems, product);\n }\n\n if (action.type === DELETE_ALL_FROM_WISHLIST) {\n return wishlistItems.filter(item => {\n return false;\n });\n }\n\n return wishlistItems;\n};\n\nexport default wishlistReducer;\n","import { ADD_TO_COMPARE, DELETE_FROM_COMPARE } from \"../actions/compareActions\";\n\nconst initState = [];\n\nconst compareReducer = (state = initState, action) => {\n const compareItems = state,\n product = action.payload;\n\n if (action.type === ADD_TO_COMPARE) {\n const compareItem = compareItems.filter(item => item.id === product.id)[0];\n if (compareItem === undefined) {\n return [...compareItems, product];\n } else {\n return compareItems;\n }\n }\n\n if (action.type === DELETE_FROM_COMPARE) {\n const remainingItems = (compareItems, product) =>\n compareItems.filter(compareItem => compareItem.id !== product.id);\n return remainingItems(compareItems, product);\n }\n\n return compareItems;\n};\n\nexport default compareReducer;\n","import currencyReducer from \"./currencyReducer\";\nimport productReducer from \"./productReducer\";\nimport cartReducer from \"./cartReducer\";\nimport wishlistReducer from \"./wishlistReducer\";\nimport compareReducer from \"./compareReducer\";\nimport { combineReducers } from \"redux\";\nimport { createMultilanguageReducer } from \"redux-multilanguage\";\n\nconst rootReducer = combineReducers({\n multilanguage: createMultilanguageReducer({ currentLanguageCode: \"es\" }),\n currencyData: currencyReducer,\n productData: productReducer,\n cartData: cartReducer,\n wishlistData: wishlistReducer,\n compareData: compareReducer\n});\n\nexport default rootReducer;\n","import { useEffect } from \"react\";\nimport { withRouter } from \"react-router-dom\";\n\nconst ScrollToTop = props => {\n useEffect(() => {\n window.scrollTo(0, 0);\n });\n return props.children;\n};\n\nexport default withRouter(ScrollToTop);\n","import PropTypes from \"prop-types\";\nimport React, { useEffect, Suspense, lazy, useState } from \"react\";\nimport ScrollToTop from \"./helpers/scroll-top\";\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\";\nimport { ToastProvider } from \"react-toast-notifications\";\nimport { multilanguage, loadLanguages } from \"redux-multilanguage\";\nimport { connect } from \"react-redux\";\nimport { BreadcrumbsProvider } from \"react-breadcrumbs-dynamic\";\nimport { AppContext } from \"./lib/contextLib\";\n\nimport { HelmetProvider } from 'react-helmet-async';\n\n// home pages\nconst HomeIndex = lazy(() => import(\"./pages/home/HomeIndex\"));\nconst MiCuenta = lazy(() => import(\"./pages/home/MiCuenta\"));\n\n// shop pages\nconst Catalogo = lazy(() => import(\"./pages/shop/Catalogo\"));\n\n// product pages\nconst Product = lazy(() => import(\"./pages/shop-product/Product\"));\nconst ProductTabLeft = lazy(() => import(\"./pages/shop-product/ProductTabLeft\"));\n\n// other pages\nconst About = lazy(() => import(\"./pages/other/About\"));\nconst Nosotros = lazy(() => import(\"./pages/other/Nosotros\"));\nconst Contact = lazy(() => import(\"./pages/other/Contact\"));\nconst Videos = lazy(() => import(\"./pages/other/Videos\"));\nconst Cursos = lazy(() => import(\"./pages/other/Cursos\"));\nconst Eventos = lazy(() => import(\"./pages/other/Eventos\"));\nconst NotFound = lazy(() => import(\"./pages/other/NotFound\"));\nconst PagoAprobado = lazy(() => import(\"./pages/other/PagoAprobado\"));\nconst Politicas = lazy(() => import(\"./pages/other/Politicas\"));\nconst Login = lazy(() => import(\"./pages/other/Login\"));\nconst Registro = lazy(() => import(\"./pages/other/Registro\"));\nconst Recuperar = lazy(() => import(\"./pages/other/Recuperar\"));\n\nconst helmetContext = {}\n\nconst App = (props) => {\n const [isAuthenticated, userHasAuthenticated] = useState(false);\n const [objUser, setObjUser] = useState(false);\n\n useEffect(() => {\n props.dispatch(\n loadLanguages({\n languages: {\n en: require(\"./translations/english.json\"),\n es: require(\"./translations/spanish.json\")\n }\n })\n );\n });\n\n return (\n \n \n \n \n \n \n \n
\n \n \n
\n \n }\n >\n \n \n\n {/* Homepages */}\n \n\n {/* Shop pages - /:category?*/} \n \n\n\n {/* Shop product pages */}\n (\n \n )}\n />\n \n\n\n {/* Other pages */}\n \n \n \n\n \n\n \n\n \n\n \n\n \n\n (\n \n )}\n /> \n\n\n \n\n \n\n \n\n\n\n {/* Not used */}\n\n \n\n\n \n \n \n
\n
\n
\n
\n
\n
\n );\n};\n\nApp.propTypes = {\n dispatch: PropTypes.func\n};\n\n\nexport default connect()(multilanguage(App));\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === \"localhost\" ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === \"[::1]\" ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === \"production\" && \"serviceWorker\" in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener(\"load\", () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n \"This web app is being served cache-first by a service \" +\n \"worker. To learn more, visit https://bit.ly/CRA-PWA\"\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === \"installed\") {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n \"New content is available and will be used when all \" +\n \"tabs for this page are closed. See https://bit.ly/CRA-PWA.\"\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log(\"Content is cached for offline use.\");\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error(\"Error during service worker registration:\", error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get(\"content-type\");\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf(\"javascript\") === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n \"No internet connection found. App is running in offline mode.\"\n );\n });\n}\n\nexport function unregister() {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import \"react-app-polyfill/ie11\";\nimport \"react-app-polyfill/stable\";\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { createStore, applyMiddleware } from \"redux\";\nimport thunk from \"redux-thunk\";\nimport { save, load } from \"redux-localstorage-simple\";\nimport { Provider } from \"react-redux\";\nimport { fetchProducts } from \"./redux/actions/productActions\";\nimport rootReducer from \"./redux/reducers/rootReducer\";\nimport products from \"./data/products.json\";\nimport App from \"./App\";\nimport \"./assets/scss/style.scss\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nimport { composeWithDevTools } from \"redux-devtools-extension\";\n\nconst store = createStore(\n rootReducer,\n load(),\n composeWithDevTools(applyMiddleware(thunk, save()))\n);\n\n// fetch products from json file\nstore.dispatch(fetchProducts(products));\n\nReactDOM.render(\n \n \n ,\n document.getElementById(\"root\")\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n","export const ADD_TO_CART = \"ADD_TO_CART\";\nexport const DECREASE_QUANTITY = \"DECREASE_QUANTITY\";\nexport const DELETE_FROM_CART = \"DELETE_FROM_CART\";\nexport const DELETE_ALL_FROM_CART = \"DELETE_ALL_FROM_CART\";\n\n//add to cart\nexport const addToCart = (\n item,\n addToast,\n quantityCount,\n selectedProductColor,\n selectedProductSize\n) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Added To Cart\", { appearance: \"success\", autoDismiss: true });\n }\n dispatch({\n type: ADD_TO_CART,\n payload: {\n ...item,\n quantity: quantityCount,\n selectedProductColor: selectedProductColor\n ? selectedProductColor\n : item.selectedProductColor\n ? item.selectedProductColor\n : null,\n selectedProductSize: selectedProductSize\n ? selectedProductSize\n : item.selectedProductSize\n ? item.selectedProductSize\n : null\n }\n });\n };\n};\n//decrease from cart\nexport const decreaseQuantity = (item, addToast) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Item Decremented From Cart\", {\n appearance: \"warning\",\n autoDismiss: true\n });\n }\n dispatch({ type: DECREASE_QUANTITY, payload: item });\n };\n};\n//delete from cart\nexport const deleteFromCart = (item, addToast) => {\n return dispatch => {\n if (addToast) {\n addToast(\"Removed From Cart\", { appearance: \"error\", autoDismiss: true });\n }\n dispatch({ type: DELETE_FROM_CART, payload: item });\n };\n};\n//delete all from cart\nexport const deleteAllFromCart = addToast => {\n return dispatch => {\n if (addToast) {\n addToast(\"Removed All From Cart\", {\n appearance: \"error\",\n autoDismiss: true\n });\n }\n dispatch({ type: DELETE_ALL_FROM_CART });\n };\n};\n\n// get stock of cart item\nexport const cartItemStock = (item, color, size) => {\n if (item.stock) {\n return item.stock;\n } else {\n return item.variation\n .filter(single => single.color === color)[0]\n .size.filter(single => single.name === size)[0].stock;\n }\n};\n"],"sourceRoot":""}