1(self.webpackChunkWPRecipeMakerPublicSplit=self.webpackChunkWPRecipeMakerPublicSplit||[]).push([[297],{1157:()=>{var e;window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.instacart={init:()=>{document.addEventListener("click",(function(e){const t=!!e.target.closest&&e.target.closest(".wprm-recipe-shop-instacart");t&&WPRecipeMaker.instacart.onClickButton(t,e)}),!1),WPRecipeMaker.instacart.show()},show:()=>{const e=document.querySelectorAll(".wprm-recipe-shop-instacart");for(let t of e)t.style.visibility=""},onClickButton:(e,t)=>{if(t.preventDefault(),e.classList.contains("wprm-recipe-shop-instacart-loading"))return;const n=parseInt(e.dataset.recipe);if(n){e.classList.add("wprm-recipe-shop-instacart-loading");const t=window.open("about:blank","_blank");t.document.write('\n <html>\n <head>\n <title>Loading Instacart...</title>\n <style>\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n }\n .loading {\n font-size: 24px;\n color: #333;\n }\n </style>\n </head>\n <body>\n <div class="loading">Loading Instacart...</div>\n </body>\n </html>\n '),window.WPRecipeMaker.manager.getRecipe(n).then((i=>{if(i){const a=i.data.currentServingsParsed+"-"+i.data.currentSystem;let r=[];if(window.WPRecipeMaker.hasOwnProperty("managerPremiumIngredients")){const e=window.WPRecipeMaker.managerPremiumIngredients.getCurrentIngredients(i).map((e=>e[`unit-system-${i.data.currentSystem}`]));for(let t of e)r.push({name:t.name,quantity:t.amountParsed,unit:t.unit})}else for(let e of i.data.ingredients)r.push({name:e.name,quantity:e.amount,unit:e.unit});let s={recipeId:n,title:i.data.name,image_url:i.data.image_url,ingredients:r,servingsSystemCombination:a};fetch(`${wprm_public.endpoints.integrations}/instacart`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({data:s})}).then((e=>!!e.ok&&e.json())).then((n=>{e.classList.remove("wprm-recipe-shop-instacart-loading"),n?t.location.href=n:alert("Something went wrong. Please try again later.")}))}}))}}},e=()=>{window.WPRecipeMaker.instacart.init()},"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.