{"version":3,"file":"product_loader-lNj2HeYi.js","sources":["../../../app/javascript/apps/customer_page/components/shared/product_card.vue","../../../app/javascript/apps/customer_page/services/product_loader.js"],"sourcesContent":["\n \n \n \n \n \n \n \n \n \n \n \n 0\" class=\"frcp-product__thumbnail\">\n \n \n \n \n \n \n {{ product.title }}\n \n \n \n \n \n \n \n \n \n \n {{ variant.title }}\n \n \n \n \n \n \n \n \n \n {{ buttonText }}\n \n \n \n\n\n\n","import objectUtils from '@CustomerPage/services/object_utils.js'\nimport fetchWrapper from '@CustomerPage/services/fetch_wrapper'\n\nconst PRODUCT_FIELDS = Object.freeze(['id', 'handle', 'title', 'price', 'variants', 'featured_image', 'available', 'media'])\n\nexport default {\n loadProduct\n}\n\nfunction loadProduct(handle, successCb, finallyCB) {\n fetchWrapper.jsonClient(`${Shopify && Shopify.routes && Shopify.routes.root || '/'}products/${handle}.js`)\n .then(response => {\n successCb(objectUtils.pick(response, PRODUCT_FIELDS))\n })\n .catch(error => {\n console.log(`Cannot load product with handle: '${handle}'`)\n })\n .finally(() => finallyCB(handle))\n}\n"],"names":["_sfc_main","SmartButton","LoadingSpinner","Icon","variantImage","productData","image","previewImage","extensionIndex","extension","delta","variantId","variantFromId","v","eventDispatcher","_hoisted_1","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_7","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_createElementBlock","$props","_openBlock","_hoisted_2","_createElementVNode","_createBlock","_component_loading_spinner","_createCommentVNode","_normalizeStyle","args","_createVNode","_component_icon","$options","_hoisted_6","_hoisted_8","_cache","$event","$data","_Fragment","_renderList","variant","_component_smart_button","_withCtx","_createTextVNode","_toDisplayString","PRODUCT_FIELDS","productLoader","loadProduct","handle","successCb","finallyCB","fetchWrapper","response","objectUtils","error"],"mappings":"qWAmEE,MAAKA,EAAU,CACb,WAAY,CAAE,YAAAC,EAAa,eAAAC,EAAgB,KAAAC,CAAM,EACjD,MAAO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