1var WPRecipeMaker;(self.webpackChunkWPRecipeMaker=self.webpackChunkWPRecipeMaker||[]).push([[89,947],{150:(e,t,r)=>{"use strict";r(4812);var i,n=r(2687);window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.conversion={init(){document.addEventListener("click",(function(e){e.target.matches(".wprm-unit-conversion")&&(e.preventDefault(),WPRecipeMaker.conversion.clickSystem(e.target)),e.target.matches(".wprm-unit-conversion-checkbox")&&WPRecipeMaker.conversion.toggleSwitch(e.target)}),!1),document.addEventListener("change",(function(e){e.target.matches(".wprm-unit-conversion-dropdown")&&WPRecipeMaker.conversion.changeDropdown(e.target)}),!1),document.addEventListener("wprm-recipe-change",(e=>{"unitSystem"===e.detail.type&&window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&(WPRecipeMaker.conversion.updateSelectors(e),WPRecipeMaker.conversion.updateTemperatures(e),wprmp_public.settings.unit_conversion_enabled&&wprmp_public.settings.unit_conversion_remember&&localStorage.setItem("wprm-unit-system",e.data.currentSystem))}))})),setTimeout((()=>{WPRecipeMaker.conversion.setPreferedUnitSystem()}),100)},setPreferedUnitSystem(){if(wprmp_public.settings.unit_conversion_enabled&&wprmp_public.settings.unit_conversion_remember){let e=localStorage.getItem("wprm-unit-system");if(e&&(e=parseInt(e),!isNaN(e)&&0<e)){const t=window.WPRecipeMaker.manager.findRecipesOnPage();for(let r of t)window.WPRecipeMaker.manager.getRecipe(r).then((t=>{t&&t.data.currentSystem!==e&&t.setUnitSystem(e)}))}}},clickSystem(e){const t=e.dataset.recipe,r=parseInt(e.dataset.system);e.classList.contains("wprmpuc-active")||(window.WPRecipeMaker.hasOwnProperty("analytics")&&window.WPRecipeMaker.analytics.registerActionOnce(t,wprm_public.post_id,"unit-conversion",{type:"link"}),this.setSystem(t,r))},toggleSwitch(e){const t=e.dataset.recipe;let r=e.checked?e.dataset.onSystem:e.dataset.offSystem;r=parseInt(r),window.WPRecipeMaker.hasOwnProperty("analytics")&&window.WPRecipeMaker.analytics.registerActionOnce(t,wprm_public.post_id,"unit-conversion",{type:"switch"}),this.setSystem(t,r)},changeDropdown(e){const t=e.dataset.recipe,r=parseInt(e.value);window.WPRecipeMaker.hasOwnProperty("analytics")&&window.WPRecipeMaker.analytics.registerActionOnce(t,wprm_public.post_id,"unit-conversion",{type:"dropdown"}),this.setSystem(t,r)},setSystem(e,t){window.WPRecipeMaker.manager.getRecipe(e).then((e=>{e&&e.setUnitSystem(t)}))},updateSelectors(e){const t=document.querySelectorAll(".wprm-unit-conversion-container-"+e.id);for(let r of t){const t=r.querySelector(".wprm-unit-conversion-dropdown"),i=r.querySelector(".wprm-unit-conversion-checkbox");if(t)t.value=e.data.currentSystem;else if(i)i.checked=e.data.currentSystem===parseInt(i.dataset.onSystem);else{const t=r.querySelectorAll(".wprm-unit-conversion");for(let r of t){const t=parseInt(r.dataset.system);e.data.currentSystem===t?r.classList.add("wprmpuc-active"):r.classList.remove("wprmpuc-active")}}}},updateTemperatures(e){if("change"===wprmp_public.settings.unit_conversion_temperature){const t=wprmp_public.settings[`unit_conversion_system_${e.data.currentSystem}_temperature`],r=document.querySelectorAll(`#wprm-recipe-container-${e.id}, .wprm-recipe-roundup-item-${e.id}, .wprm-print-recipe-${e.id}, .wprm-recipe-${e.id}-instructions-container`);for(let e of r){const r=e.querySelectorAll(".wprm-temperature-container");for(let e of r){const r=WPRecipeMaker.temperature.getData(e);if((e.dataset.hasOwnProperty("currentUnit")?e.dataset.currentUnit:r.unit)!==t){let i;if(t===r.unit)i=r.value;else{const e=(0,n.L)(r.value);i="C"===t?5*(e-32)/9:9*e/5+32,"round_5"===wprmp_public.settings.unit_conversion_temperature_precision?i=5*Math.round(i/5):"round_10"===w
1prmp_public.settings.unit_conversion_temperature_precision&&(i=10*Math.round(i/10)),i=(0,n.V)(i,0)}e.querySelector(".wprm-temperature-value").innerHTML=i,e.querySelector(".wprm-temperature-unit").innerHTML=` °${t}`,e.dataset.currentUnit=t}}}}}},i=()=>{window.WPRecipeMaker.conversion.init()},"loading"!=document.readyState?i():document.addEventListener("DOMContentLoaded",i)},4812:(e,t,r)=>{"use strict";var i,n=r(4558),a=(r(2998),r(2687));window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.advancedServings={load(){document.addEventListener("wprm-recipe-change",(e=>{"servings"===e.detail.type&&window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&WPRecipeMaker.advancedServings.adjustedServingsDirectly(e)})),"advancedServings"===e.detail.type&&window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&WPRecipeMaker.advancedServings.updateAdvancedServingsDisplay(e)})),"unitSystem"===e.detail.type&&window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&WPRecipeMaker.advancedServings.updateUnitOnUnitSystemChange(e)}))})),window.WPRecipeMaker.advancedServings.init()},init(){if(!document.querySelector("body").classList.contains("wprm-print")){const e=document.querySelectorAll("span.wprm-recipe-advanced-servings-input");for(let t of e){let e=document.createElement("a");e.innerHTML=t.innerHTML,e.setAttribute("href","#"),e.setAttribute("role","button");const r=[...t.attributes].reduce(((e,t)=>(e[t.name]=t.value,e)),{});for(let t of Object.keys(r))e.setAttribute(t,r[t]);t.parentNode.replaceChild(e,t),e.onclick=e=>{e.preventDefault(),WPRecipeMaker.advancedServings.onClickInput(e.target)},r.hasOwnProperty("aria-label")&&(0,n.Ay)(e,{theme:"wprm",content:r["aria-label"]})}}},onClickInput(e){e.classList.contains("wprm-recipe-advanced-servings-input-shape")?WPRecipeMaker.advancedServings.toggleShape(e):e.classList.contains("wprm-recipe-advanced-servings-input-unit")?WPRecipeMaker.advancedServings.toggleUnit(e):WPRecipeMaker.advancedServings.changeNumber(e)},changeNumber(e){WPRecipeMaker.advancedServings.getRecipeFromElem(e).then((t=>{if(t){const r=e.getAttribute("aria-label"),i=e.innerText,n=prompt(`${r}:`,i);if(n){const r=WPRecipeMaker.advancedServings.parse(n);if(r&&0<r){let i={};i[e.dataset.type]=r,t.setAdvancedServings(i)}}}}))},toggleShape(e){WPRecipeMaker.advancedServings.getRecipeFromElem(e).then((e=>{if(e){const t="round"===e.data.currentAdvancedServings.shape?"rectangle":"round";e.setAdvancedServings({shape:t})}}))},toggleUnit(e){WPRecipeMaker.advancedServings.getRecipeFromElem(e).then((e=>{if(e){const t="cm"===e.data.currentAdvancedServings.unit?"inch":"cm";e.setAdvancedServings({unit:t})}}))},adjustedServingsDirectly(e){const t=WPRecipeMaker.advancedServings.getServingsFromAdvancedServings(e),r=e.data.currentServingsParsed;r!==t&&(r===e.data.originalServingsParsed?e.setAdvancedServings(e.data.originalAdvancedServings):e.setAdvancedServings({diameter:"?",width:"?",length:"?"}))},getRecipeFromElem(e){let t=!1;for(var r=e.parentNode;r&&r!=document;r=r.parentNode)if(r.matches(".wprm-recipe-advanced-servings-container")){t=r;break}return t?window.WPRecipeMaker.manager.getRecipe(t.dataset.recipe):Promise.resolve(!1)},updateUnitOnUnitSystemChange(e){if(wprmp_public.settings.unit_conversion_advanced_servings_conversion){const t=wprmp_public.settings[`unit_conversion_system_${e.data.currentSystem}_length_unit`];t!==e.data.currentAdvancedServings.unit&&e.setAdvancedServings({unit:t})}},updateAdvancedServingsDisplay(e){const t=document.querySelectorAll(`.wprm-recipe-advanced-servings-${e.id}-container`),r=e.data.currentAdvancedServings;for(let n of t){const e=n.querySelector(".wprm-recipe-advanced-servings-input-shape");e.innerHTML=e.dataset[`shape${r.shape[0].toUpperCase()+r.shape.slice(1)}`],"round"===r.shape?(n.querySelector(".wprm-recipe-advanced-servings-round").style.display="",n.querySelector(".wprm-recipe-advanced-servings-rectangle").style.display="none"):(n.querySelector(".wprm-recipe-advanced-servings-rectangle").style.display="",n.querySelector(".wprm-recipe-advanced-servings-round").style.display="none");const t=n.querySelectorAll(".wprm-recipe-advanced-servings-input-unit");for(let i of t)i.innerHTML=i.dataset[`unit${r.unit[0].toUpperCase()+r.unit.slice(1)}`];n.querySelector(".wprm-recipe-advanced-servings-input-diameter").innerHTML=WPRecipeMaker.advancedServings.format(r.diameter),n.querySelector(".wprm-recipe-advanced-servings-input-width").innerHTML=WPRecipeMaker.advancedServings.format(r.width),n.querySelector(".wprm-recipe-advanced-servings-input-length").innerHTML=WPRecipeMaker.advancedServings.format(r.length),r.height&&(n.querySelector(".wprm-recipe-advanced-servings-input-height").innerHTML=WPRecipeMaker.advancedServings.format(r.height))}const i=WPRecipeMaker.advancedServings.getServingsFromAdvancedServings(e);i&&e.setServings(i)},getServingsFromAdvancedServings(e){if(e){const t=e.data.currentAdvancedServings,r=e.data.originalAdvancedServings;if("?"===t.height)return!1;if("round"===t.shape){if("?"===t.diameter)return!1}else if("?"===t.width||"?"===t.length)return!1;const i=0<r.height;let n=WPRecipeMaker.advancedServings.getArea(r),a=WPRecipeMaker.advancedServings.getArea(t);
1if(i){n*="inch"===r.unit?2.54*r.height:r.height,a*="inch"===t.unit?2.54*t.height:t.height}const s=a/n;return e.data.originalServingsParsed*s}return!1},getArea(e){let t=e.diameter/2,r=e.width,i=e.length;return"inch"===e.unit&&(t*=2.54,r*=2.54,i*=2.54),"round"===e.shape?Math.PI*t*t:r*i},parse:e=>(0,a.L)(e),format(e){const t=(0,a.V)(e,wprmp_public.settings.adjustable_servings_round_to_decimals);return isNaN(t)?e:t}},i=()=>{window.WPRecipeMaker.advancedServings.load()},"loading"!=document.readyState?i():document.addEventListener("DOMContentLoaded",i);r(4123);window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.managerPremiumIngredients={load(){document.addEventListener("wprm-recipe-change",(e=>{"servings"!==e.detail.type&&"unitSystem"!==e.detail.type||window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&WPRecipeMaker.managerPremiumIngredients.updateIngredientsDisplay(e)}))}))},getCurrentIngredients(e){e.data.hasOwnProperty("ingredientsElements")||window.WPRecipeMaker.managerPremiumIngredients.findIngredientsElements(e);let t=[];const r=e.data.currentServingsParsed===e.data.originalServingsParsed&&e.data.currentSystem===e.data.originalSystem;for(let i=0;i<e.data.ingredients.length;i++){const n=e.data.ingredients[i];let a={};for(let t=1;t<=2;t++){let i,s;n.unit_systems.hasOwnProperty("unit-system-"+t)?(i=n.unit_systems["unit-system-"+t],s=!1):(i=n.unit_systems["unit-system-"+(t%2+1)],s=!0);let o=wprmp_public.settings.fractions_enabled;wprmp_public.settings.unit_conversion_enabled&&window.WPRecipeMaker.hasOwnProperty("conversion")&&(o=!wprmp_public.settings.hasOwnProperty(`unit_conversion_system_${t}_fractions`)||wprmp_public.settings[`unit_conversion_system_${t}_fractions`]);let c=i.amount,p=i.amountString,d=!1,l=!1;for(let t=0;t<i.amountParts.length;t++){const r=i.amountParts[t].numberUnitQuantity*e.data.currentServingsParsed;!isNaN(r)&&0<r&&(0===t&&(l=r<=1,d=r),p=p.replace(`%wprm${t}%`,this.format(r,o)))}!1===/%wprm\d+%/g.test(p)&&(c=p),r?c=i.amount:e.data.currentServingsParsed!==e.data.originalServingsParsed||s||(c=i.amount);let m=i.unitParsed;if(!r)if(e.data.currentServingsParsed!==e.data.originalServingsParsed||s){const e=!!i.hasOwnProperty("unit_singular")&&i.unit_singular,t=!!i.hasOwnProperty("unit_plural")&&i.unit_plural;m=i.unitParsed,e&&t&&(m=l?e:t)}else m=i.unitParsed;let u=n.name,g=!1;if(!r){const e=!!n.hasOwnProperty("name_singular")&&n.name_singular,t=!!n.hasOwnProperty("name_plural")&&n.name_plural;e&&t&&(g=!0,u=l?e:t)}a["unit-system-"+t]={amount:c,amountParsed:d,amountIsSingular:l,unit:m,name:u,needsNameChange:g}}t.push(a)}return t},updateIngredientsDisplay(e){e.data.hasOwnProperty("ingredientsElements")||window.WPRecipeMaker.managerPremiumIngredients.findIngredientsElements(e);const t=e.data.hasOwnProperty("overrideContainerId")&&!1!==e.data.overrideContainerId?e.data.overrideContainerId:e.id,r=e.data.currentServingsParsed===e.data.originalServingsParsed&&e.data.currentSystem===e.data.originalSystem,i=window.WPRecipeMaker.managerPremiumIngredients.getCurrentIngredients(e);for(let n=0;n<e.data.ingredients.length;n++){const a=e.data.ingredients[n],s=e.data.ingredientsElements[n],o=i[n];for(let t of s){for(let i=0;i<t.amounts.length;i++){const n=t.amounts[i];let a=e.data.currentSystem;t.showingBothUnitSystems&&1===i&&(a=a%2+1);const s=o["unit-system-"+a];n.elem.innerHTML=r?n.original:s.amount,t.units.hasOwnProperty(i)&&(t.units[i].elem.innerHTML=r?t.units[i].original:s.unit)}t.name&&(o["unit-system-"+e.data.currentSystem].needsNameChange?t.name.elem.innerHTML=o["unit-system-"+e.data.currentSystem].name:t.name.elem.innerHTML=t.name.original)}if(!1!==a.uid&&1<=s.length){const e=document.querySelectorAll(".wprm-inline-ingredient-"+t+"-"+a.uid+", .wprm-recipe-instruction-ingredient-"+t+"-"+a.uid);if(0<e.length){let t="",r="";for(let e of s){const i=document.createElement("div");i.innerHTML=e.elem.innerHTML,Array.from(i.childNodes).forEach((e=>{e.nodeType===Node.TEXT_NODE&&(e.textContent=e.textContent.replace(/[,-]/g,""))}));const n=i.querySelector(".wprm-recipe-ingredient-notes");n&&(r=n.innerText,n.remove());const a=i.querySelector(".wprm-checkbox-container");a&&a.remove();const s=i.querySelector(".wprm-recipe-ingredient-image");if(s&&s.remove(),t=i.innerText,t=t.replace(/\s\s+/g," "),t=t.trim(),t)break}if(t)for(let i of e){let e=t;if(r){const t=!!i.dataset.hasOwnProperty("notesSeparator")&&i.dataset.notesSeparator;if(!1!==t)switch(r.startsWith("(")&&r.endsWith(")")&&(r=r.substring(1,r.length-1)),t){case"comma":e+=", "+r;break;case"dash":e+=" - "+r;break;case"parentheses":e+=" ("+r+")";break;default:e+=" "+r}}i.dataset.hasOwnProperty("separator")&&(e+=i.dataset.separator),i.innerText=e}}}}window.WPRecipeMaker.quantities.findAdjustables(e)},findIngredientsElements(e){let t=[];for(let n=0;n<e.data.ingredients.length;n++){const r=e.data.ingredients[n];for(let t of Object.keys(r.unit_systems)){const i=r.unit_systems[t],a=window.WPRecipeMaker.managerPremiumIngredients.parseAmountString(i.amount,e.data.originalServingsParsed);e.data.ingredients[n].unit_systems[t]={...e.data.ingredients[n].unit_systems[t],...a}}t[n]=[]}const r=e.data.hasOwnProperty("overrideContainerId")&&!1!==e.data.overrideContainerId?e.data.overrideContainerId:e.id,i=document.querySelectorAll(`#wprm-recipe-container-${r}, .wprm-recipe-roundup-item-${r}, .wprm-print-recipe-${r}, .wprm-recipe-${r}-ingredients-container, .wprm-recipe-${r}-instructions-container`);for(let n of i){const r=n.querySelectorAll(".wprm-recipe-ingredient");for(let i=0;i<r.length;i++){const n=r[i];if(!n.dataset.hasOwnProperty("wprmParsed")){let r={elem:n,showingBothUnitSystems:!1,amounts:[],units:[],name:!1,notes:!1};n.querySelector(".wprm-recipe-ingredient-unit-system")&&(r.showingBothUnitSystems=!0);const s=n.querySelectorAll(".wprm-recipe-ingredient-amount");for(let t of s)r.amounts.push({elem:t,original:t.innerHTML,unitQuantity:(0,a.L)(t.innerText)/e.data.originalServingsParsed});const o=n.querySelectorAll(".wprm-recipe-ingredient-unit");for(let e of o)r.units.push({elem:e,original:e.innerHTML});const c=n.querySelector(".wprm-recipe-ingredient-name");c&&(r.name={elem:c,original:c.innerHTML});const p=n.querySelector(".wprm-recipe-ingredient-notes");p&&(r.notes={elem:p,original:p.innerHTML}),n.dataset.wprmParsed=!0,t.hasOwnProperty(i)&&t[i].push(r)}}}window.WPRecipeMaker.manager.changeRecipeData(e.id,{ingredientsElements:t})},parseAmountString(e,t){e=(e=(e=e.replace(/"/g,'"')).replace(/'/g,"'")).replace(/&/g,"&");let r=!1;if(/^\.\d+\s*$/.test(e))r=[e];else{const t="¼½¾â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
",i="[\\d"+t+"]([\\d"+t+".,\\/\\s]*[\\d"+t+"])?",n=e.match(new RegExp(i,"g"));n&&(r=n)}let i=[];if(r){for(let n=0;n<r.length;n++){const s=r[n];e=e.replace(s,"%wprmtemporaryplaceholder%");const o=(0,a.L)(s);i.push({number:s,numberParsed:o,numberUnitQuantity:o/t})}for(let t=0;t<r.length;t++)e=e.replace("%wprmtemporaryplaceholder%",`%wprm${t}%`)}return{amountString:e,amountParts:i}},format:(e,t=!0)=>(0,a.V)(e,wprmp_public.settings.adjustable_servings_round_to_decimals,t)},function(e){"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}((()=>{window.WPRecipeMaker.managerPremiumIngredients.load()})),window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.managerPremium={loadRecipeObject:(e,t)=>
1({...t,data:{...t.data},addRating:t=>(window.WPRecipeMaker.hasOwnProperty("analytics")&&window.WPRecipeMaker.analytics.registerAction(e,wprm_public.post_id,"user-rating",{rating:t.rating}),window.WPRecipeMaker.userRating.addRatingForRecipe(t,e).then((t=>!1!==t&&(window.WPRecipeMaker.manager.changeRecipeData(e,{rating:t}),window.WPRecipeMaker.manager.triggerChangeEvent(e,"rating"),!0)))),setServings:(r,i=!1)=>{const n=(0,a.L)(r),s=(0,a.V)(n,wprmp_public.settings.adjustable_servings_round_to_decimals,!1),o=n/t.data.originalServingsParsed;window.WPRecipeMaker.manager.changeRecipeData(e,{currentServings:r,currentServingsParsed:n,currentServingsFormatted:s,currentServingsMultiplier:o,overrideContainerId:i}),window.WPRecipeMaker.manager.triggerChangeEvent(e,"servings")},setAdvancedServings:t=>{window.WPRecipeMaker.manager.getRecipe(e).then((r=>{if(t.hasOwnProperty("unit")&&t.unit!==r.data.currentAdvancedServings.unit){const e=2.54,i="cm"===t.unit?e:1/e;"?"!==r.data.currentAdvancedServings.diameter&&(t.diameter=Math.round(r.data.currentAdvancedServings.diameter*i)),"?"!==r.data.currentAdvancedServings.width&&(t.width=Math.round(r.data.currentAdvancedServings.width*i)),"?"!==r.data.currentAdvancedServings.length&&(t.length=Math.round(r.data.currentAdvancedServings.length*i)),"?"!==r.data.currentAdvancedServings.height&&(t.height=Math.round(r.data.currentAdvancedServings.height*i))}window.WPRecipeMaker.manager.changeRecipeData(e,{currentAdvancedServings:{...r.data.currentAdvancedServings,...t}}),window.WPRecipeMaker.manager.triggerChangeEvent(e,"advancedServings")}))},setUnitSystem:r=>{r=parseInt(r),t.data.unitSystems.includes(r)&&(window.WPRecipeMaker.manager.changeRecipeData(e,{currentSystem:r}),window.WPRecipeMaker.manager.triggerChangeEvent(e,"unitSystem"))}})};r(4096),r(5095);var s=r(942);window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.quantities={load(){if(document.addEventListener("input",(function(e){e.target.matches("input.wprm-recipe-servings")&&WPRecipeMaker.quantities.inputChange(e.target)}),!1),document.addEventListener("change",(function(e){e.target.matches("input.wprm-recipe-servings")&&WPRecipeMaker.quantities.inputChange(e.target)}),!1),document.addEventListener("click",(function(e){e.target.matches(".wprm-recipe-servings-change")&&WPRecipeMaker.quantities.changeClick(e.target),e.target.matches(".wprm-recipe-adjustable-servings")&&WPRecipeMaker.quantities.multiplierClick(e.target)}),!1),document.addEventListener("keypress",(function(e){if(e.target.matches(".wprm-recipe-servings-change")){const t=e.which||e.keyCode||0;13!==t&&32!==t||(WPRecipeMaker.quantities.changeClick(e.target),e.preventDefault())}}),!1),document.addEventListener("wprm-recipe-change",(e=>{"servings"===e.detail.type&&window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&(WPRecipeMaker.quantities.updateServingsDisplay(e),WPRecipeMaker.quantities.updateAdjustables(e),document.dispatchEvent(new CustomEvent("wprmAdjustedServings",{detail:e.id})))})),"unitSystem"===e.detail.type&&window.WPRecipeMaker.manager.getRecipe(e.detail.id).then((e=>{e&&WPRecipeMaker.quantities.updateAdjustables(e)}))})),window.WPRecipeMaker.quantities.init(),wprmp_public.settings.adjustable_servings_url){const e=wprmp_public.settings.adjustable_servings_url_param;if(e){const t=new URLSearchParams(window.location.search),r=parseFloat(t.get(e));if(!isNaN(r)&&0<r){const e=window.WPRecipeMaker.manager.findRecipesOnPage();for(let t of e)window.WPRecipeMaker.manager.getRecipe(t).then((e=>{e.setServings(r)}))}}}},init(){const e=document.querySelectorAll(".wprm-recipe-servings");for(let t of e)if(!t.dataset.hasOwnProperty("servings")){const e=this.parse(t.innerText);0<e&&(t.dataset.servings=e,t.dataset.originalServings=e,document.querySelector("body").classList.contains("wprm-print")||("modern"===wprmp_public.settings.recipe_template_mode?t.classList.contains("wprm-recipe-servings-adjustable-tooltip")?this.initTooltipSlider(t):t.classList.contains("wprm-recipe-servings-adjustable-text")?this.initTextInput(t):t.classList.contains("wprm-recipe-servings-adjustable-text-buttons")&&this.initTextButtonsInput(t):wprmp_public.settings.features_adjustable_servings&&("text_field"===wprmp_public.settings.servings_changer_display?this.initTextInput(t):this.initTooltipSlider(t))))}},getRecipeIdFromElem(e){let t=e.dataset.recipe;if(!t)for(var r=e.parentNode;r&&r!=document;r=r.parentNode)if(r.matches(".wprm-recipe-container")){t=r.dataset.recipeId;break}return t},initTextInput(e){let t=e.dataset.servings,r=this.getRecipeIdFromElem(e),i=e.getAttribute("aria-label");if(r){const n='<input type="number" class="wprm-recipe-servings wprm-recipe-servings-'+r+'" min="0" step="any" value="'+t+'" data-recipe="'+r+'" aria-label="'+i+'" />';e.outerHTML=n}},initTextButtonsInput(e){let t=e.dataset.servings,r=this.getRecipeIdFromElem(e),i=e.getAttribute("aria-label");if(r){let n="";
1n+="background-color: "+e.dataset.buttonBackground+";",n+="border-color: "+e.dataset.buttonBackground+";",n+="color: "+e.dataset.buttonAccent+";",n+="border-radius: "+e.dataset.buttonRadius+";";let a="";a+="border-color: "+e.dataset.buttonBackground+";";const o='<span class="wprm-recipe-servings-decrement wprm-recipe-servings-change" style="'+n+'" role="button" tabindex="0" aria-label="'+(0,s.f)("Decrease serving size by 1")+'">â</span>',c='<input type="text" class="wprm-recipe-servings wprm-recipe-servings-'+r+'" min="0" step="any" value="'+t+'" data-recipe="'+r+'" aria-label="'+i+'" style="'+a+'"/>',p='<span class="wprm-recipe-servings-increment wprm-recipe-servings-change" style="'+n+'" role="button" tabindex="0" aria-label="'+(0,s.f)("Increase serving size by 1")+'">+</span>';e.outerHTML='<span class="wprm-recipe-servings-text-buttons-container">'+o+c+p+"</span>"}},initTooltipSlider(e){let t=this.getRecipeIdFromElem(e),r=e.getAttribute("aria-label");if(t){let i=document.createElement("a");i.href="#",i.classList.add("wprm-recipe-servings-link"),i.setAttribute("aria-label",r),e.parentNode.insertBefore(i,e),i.appendChild(e);const a=(0,n.Ay)(i,{theme:"wprm",content:"",onShow(e){window.WPRecipeMaker.manager.getRecipe(t).then((i=>{if(!i)return!1;{const n=i.data.currentServingsParsed,a=20<2*n?2*n:20,s=function(e){const t=e.toString().split(".");return t.length>1?t[1].length:0}(n),o=1/Math.pow(10,s);e.setContent(`<input id="wprm-recipe-servings-slider-input" type="range" min="1" max="${a}" step="${o}" value="${n}" data-recipe="${t}" class="wprm-recipe-servings-slider wprm-recipe-servings-${t}" aria-label="${r}" oninput="WPRecipeMaker.quantities.inputChange(this)" onchange="WPRecipeMaker.quantities.inputChange(this)"></input>`)}}))},allowHTML:!0,interactive:!0,delay:[0,250]});i.onclick=e=>{e.preventDefault(),a.show(),setTimeout((()=>{const e=document.getElementById("wprm-recipe-servings-slider-input");e&&e.focus()}),250)}}},inputChange(e){let t=e.value,r=e.dataset.recipe;if(t){const i=e.classList.contains("wprm-recipe-servings-slider")?"slider":"input";window.WPRecipeMaker.analytics.registerActionOnce(r,wprm_public.post_id,"adjust-servings",{type:i}),this.setServings(r,t)}},changeClick(e){const t=e.closest(".wprm-recipe-servings-text-buttons-container");if(t){const r=t.querySelector("input"),i=this.parse(r.value);let n=i;e.classList.contains("wprm-recipe-servings-decrement")&&i>1?n--:e.classList.contains("wprm-recipe-servings-increment")&&n++,n!==i&&(r.value=n,this.inputChange(r))}},multiplierClick(e){if(!e.classList.contains("wprm-toggle-active")||"?"===e.dataset.multiplier){const t=e.dataset.multiplier,r=e.dataset.recipe,i=e.dataset.servings;let n=!1;"?"===t?(n=prompt(e.getAttribute("aria-label")),n&&(n=this.parse(n))):n=this.parse(i)*this.parse(t),n&&(window.WPRecipeMaker.analytics.registerActionOnce(r,wprm_public.post_id,"adjust-servings",{type:"button"}),this.setServings(r,n))}},setServings(e,t){window.WPRecipeMaker.manager.getRecipe(e).then((e=>{e&&e.setServings(t)}))},updateServingsDisplay(e){const t=e.data.hasOwnProperty("overrideContainerId")&&!1!==e.data.overrideContainerId?e.data.overrideContainerId:e.id,r=document.querySelectorAll(".wprm-recipe-servings-"+t);for(let n of r)n.textContent=e.data.currentServingsFormatted,n.dataset.servings=e.data.currentServingsParsed,"input"===n.tagName.toLowerCase()?"string"==typeof e.data.currentServings||e.data.currentServings instanceof String?n.value=e.data.currentServings:n.value=e.data.currentServingsFormatted:n.value=e.data.currentServingsParsed;const i=document.querySelectorAll(".wprm-recipe-adjustable-servings-"+t+"-container");for(let n of i){const t=n.querySelectorAll(".wprm-recipe-adjustable-servings");let r=!1;for(let i of t)i.classList.remove("wprm-toggle-active"),(0,a.L)(i.dataset.multiplier)===e.data.currentServingsMultiplier?(r=!0,i.classList.add("wprm-toggle-active")):"?"!==i.dataset.multiplier||r||i.classList.add("wprm-toggle-active")}},updateAdjustables(e){e.data.hasOwnProperty("adjustables")||window.WPRecipeMaker.quantities.findAdjustables(e);for(let t of e.data.adjustables)if(e.data.currentServingsParsed===e.data.originalServingsParsed)t.elem.textContent=t.original;else{const r=e.data.currentServings*t.unitQuantity;if(!isNaN(r)){let i=!0;if(wprmp_public.settings.unit_conversion_enabled&&window.WPRecipeMaker.hasOwnProperty("conversion")){const t=e.data.hasOwnProperty("currentSystem")?e.data.currentSystem:1;i=!wprmp_public.settings.hasOwnProperty(`unit_conversion_system_${t}_fractions`)||wprmp_public.settings[`unit_conversion_system_${t}_fractions`]}t.elem.textContent=this.format(r,i)}}},findAdjustables(e){let t=e.data.hasOwnProperty("adjustables")?e.data.adjustables:[];for(let i=t.length-1;i>=0;i--)document.body.contains(t[i].elem)||t.splice(i,1);const r=document.querySelectorAll(`#wprm-recipe-container-${e.id}, .wprm-recipe-roundup-item-${e.id}, .wprm-print-recipe-${e.id}, .wprm-recipe-${e.id}-ingredients-container, .wprm-recipe-${e.id}
1-instructions-container`);for(let i of r){const r=i.querySelectorAll(".wprm-dynamic-quantity");for(let e of r)if(0===e.querySelectorAll(".wprm-adjustable").length){let t=e.innerText;if(/^\.\d+\s*$/.test(t))e.innerHTML='<span class="wprm-adjustable">'+t+"</span>";else{const r="¼½¾â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
",i="[\\d"+r+"]([\\d"+r+".,\\/\\s]*[\\d"+r+"])?",n='<span class="wprm-adjustable">$&</span>';t=t.replace(new RegExp(i,"g"),n),e.innerHTML=t}}const n=i.querySelectorAll(".wpurp-adjustable-quantity");for(let e of n)e.classList.add("wprm-adjustable");const s=i.querySelectorAll(".wprm-adjustable");for(let i of s)-1===t.findIndex((e=>e.elem===i))&&t.push({elem:i,original:i.innerText,unitQuantity:(0,a.L)(i.innerText)/e.data.originalServingsParsed})}window.WPRecipeMaker.manager.changeRecipeData(e.id,{adjustables:t})},parse:e=>(0,a.L)(e),format:(e,t=!0)=>(0,a.V)(e,wprmp_public.settings.adjustable_servings_round_to_decimals,t)},function(e){"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}((()=>{window.WPRecipeMaker.quantities.load()})),window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.timer={init:()=>{const e=document.querySelector("body");if(e&&e.classList.contains("wprm-print"))return;const t=document.querySelectorAll(".wprm-timer");for(let r of t){const e=r.dataset.seconds;if(e>0){let t=document.createElement("a");t.href="#",t.classList.add("wprm-timer-link"),t.onclick=t=>{t.preventDefault(),t.stopPropagation(),window.WPRecipeMaker.timer.start(e)},r.parentNode.insertBefore(t,r),t.appendChild(r),(0,n.Ay)(t,{theme:"wprm",content:wprmp_public.timer.text.start_timer})}}},runningTimer:!1,runningTotal:0,runningRemaining:0,lastUpdated:0,update:()=>{const e=Date.now()-window.WPRecipeMaker.timer.lastUpdated;window.WPRecipeMaker.timer.runningRemaining-=e,window.WPRecipeMaker.timer.lastUpdated=Date.now();const t=window.WPRecipeMaker.timer.runningTotal;let r=window.WPRecipeMaker.timer.runningRemaining;r<=0&&(r=0,window.WPRecipeMaker.timer.finished()),window.WPRecipeMaker.timer.showTime(Math.round(r/1e3));const i=100*(t-r)/t;document.querySelector("#wprm-timer-bar-elapsed").style.width=i+"%"},start:e=>{window.WPRecipeMaker.timer.stop((()=>{window.WPRecipeMaker.timer.createContainer(),window.WPRecipeMaker.timer.runningTotal=1e3*e,window.WPRecipeMaker.timer.runningRemaining=1e3*e,window.WPRecipeMaker.timer.showTime(e),window.WPRecipeMaker.timer.play()}))},play:()=>{document.querySelector("#wprm-timer-play").style.display="none",document.querySelector("#wprm-timer-pause").style.display="",window.WPRecipeMaker.timer.interval&&clearInterval(window.WPRecipeMaker.timer.interval),window.WPRecipeMaker.timer.interval=setInterval(window.WPRecipeMaker.timer.update,1e3),window.WPRecipeMaker.timer.lastUpdated=Date.now()},pauze:()=>{document.querySelector("#wprm-timer-play").style.display="",document.querySelector("#wprm-timer-pause").style.display="none",window.WPRecipeMaker.timer.interval&&clearInterval(window.WPRecipeMaker.timer.interval)},stop:(e=!1)=>{window.WPRecipeMaker.timer.interval&&clearInterval(window.WPRecipeMaker.timer.interval);let t=document.querySelector("#wprm-timer-container");t&&t.parentNode.removeChild(t),e&&e()},finished:()=>{window.WPRecipeMaker.timer.pauze();new Audio(wprmp_public.timer.sound_file).play(),document.querySelector("#wprm-timer-container").classList.add("wprm-timer-finished")},createContainer:()=>{let e=document.createElement("div");e.id="wprm-timer-container",e.innerHTML='<span id="wprm-timer-play" class="wprm-timer-icon" onclick="window.WPRecipeMaker.timer.play()">'+wprmp_public.timer.icons.play+"</span>",e.innerHTML+='<span id="wprm-timer-pause" class="wprm-timer-icon" onclick="window.WPRecipeMaker.timer.pauze()">'+wprmp_public.timer.icons.pause+"</span>",e.innerHTML+='<span id="wprm-timer-remaining"></span>',e.innerHTML+='<span id="wprm-timer-bar-container"><span id="wprm-timer-bar"><span id="wprm-timer-bar-elapsed"></span></span></span>',e.innerHTML+='<span id="wprm-timer-close" class="wprm-timer-icon" onclick="window.WPRecipeMaker.timer.stop()">'+wprmp_public.timer.icons.close+"</span>",document.querySelector("body").appendChild(e)},showTime:e=>{var t=Math.floor(e/3600);e-=3600*t;var r=Math.floor(e/60);const i=(t<10?"0"+t:t)+":"+(r<10?"0"+r:r)+":"+((e-=60*r)<10?"0"+e:e);document.querySelector("#wprm-timer-remaining").textContent=i}},function(e){"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}((()=>{window.WPRecipeMaker.timer.init()}));r(2359);var o=r(5266);window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}
1:window.WPRecipeMaker,window.WPRecipeMaker.userRating={init(){document.addEventListener("wprm-recipe-change",(e=>{if("rating"===e.detail.type){const t=e.detail.id;window.WPRecipeMaker.manager.getRecipe(t).then((e=>{e&&window.WPRecipeMaker.userRating.updateRatingDisplay(t,e.data.rating)}))}}))},settings:{color:wprmp_public.settings.template_color_icon},enter(e){e.parentNode.classList.add("wprm-user-rating-voting");let t=window.WPRecipeMaker.userRating.settings.color;"modern"===wprmp_public.settings.recipe_template_mode&&e.dataset.color&&(t=e.dataset.color);let r=e;for(;r;){r.classList.add("wprm-rating-star-selecting-filled");const e=r.querySelectorAll("polygon, path");for(let r of e)r.style.fill=t;r=r.previousSibling}let i=e.nextSibling;for(;i;){i.classList.add("wprm-rating-star-selecting-empty");const e=i.querySelectorAll("polygon, path");for(let t of e)t.style.fill="none";i=i.nextSibling}},leave(e){e.parentNode.classList.remove("wprm-user-rating-voting");let t=e.parentNode.firstChild;for(;t;){t.classList.remove("wprm-rating-star-selecting-filled"),t.classList.remove("wprm-rating-star-selecting-empty");const e=t.querySelectorAll("polygon, path");for(let t of e)t.style.fill="";t=t.nextSibling}},click(e,t){const r=t.which||t.keyCode||0;if("click"===t.type||13===r||32===r){t.preventDefault();const r=e.parentNode;let n=parseInt(e.dataset.rating),a=parseInt(r.dataset.recipe);if(!a)for(var i=e.parentNode;i&&i!=document;i=i.parentNode)if(i.matches(".wprm-recipe-container")){a=parseInt(i.dataset.recipeId);break}if("scroll"===wprmp_public.settings.user_ratings_type&&window.WPRecipeMaker.userRating.canJumpToComments())window.WPRecipeMaker.userRating.jumpToCommentRating(n);else{const e=r.dataset.modalUid;window.WPRecipeMaker.modal.open(e,{recipe:a,rating:n})}}},updateRatingDisplay(e,t){const r=document.querySelectorAll(".wprm-recipe-rating-recipe-"+e);for(let i of r){let e=i.dataset.hasOwnProperty("decimals")?parseInt(i.dataset.decimals):2;e=0<=e?e:2,t.roundedAverage=Number(t.average.toFixed(e)),t.formattedAverage=(0,a.V)(t.average,e);const r=i.querySelector(".wprm-recipe-rating-details");if(r)r.innerHTML=window.WPRecipeMaker.userRating.getRatingDetailsText(t);else{const e=i.querySelector(".wprm-recipe-rating-average"),r=i.querySelector(".wprm-recipe-rating-count");e&&(e.innerText=t.formattedAverage),r&&(r.innerText=t.count)}const n=t.roundedAverage;for(let t=1;t<=5;t++){let e=i.querySelector(".wprm-rating-star-"+t);if(e)if(e.classList.remove("wprm-rating-star-full"),e.classList.remove("wprm-rating-star-empty"),e.classList.remove("wprm-rating-star-33"),e.classList.remove("wprm-rating-star-50"),e.classList.remove("wprm-rating-star-66"),t<=n)e.classList.add("wprm-rating-star-full");else{const r=0+n-t+1;0<r&&r<=.33?e.classList.add("wprm-rating-star-33"):0<r&&r<=.5?e.classList.add("wprm-rating-star-50"):0<r&&r<=.66?e.classList.add("wprm-rating-star-66"):0<r&&r<=1?e.classList.add("wprm-rating-star-full"):e.classList.add("wprm-rating-star-empty")}}i.classList.contains("wprm-user-rating")&&(0<t.user?(i.classList.remove("wprm-user-rating-not-voted"),i.classList.add("wprm-user-rating-has-voted")):(i.classList.add("wprm-user-rating-not-voted"),i.classList.remove("wprm-user-rating-has-voted")))}},getRatingDetailsText(e){let t="",r="";if(r=0===e.count?wprmp_public.settings.rating_details_zero:1===e.count?wprmp_public.settings.rating_details_one:wprmp_public.settings.rating_details_multiple,0<e.user){const e=wprmp_public.settings.rating_details_user_voted;r=r.replace("%not_voted%",""),r=r.replace("%voted%",e)}else{const e=wprmp_public.settings.rating_details_user_not_voted;r=r.replace("%voted%",""),r=r.replace("%not_voted%",e)}return r=r.replace("%average%",'<span class="wprm-recipe-rating-average">'+e.formattedAverage+"</span>"),r=r.replace("%votes%",'<span class="wprm-recipe-rating-count">'+e.count+"</span>"),r=r.replace("%user%",'<span class="wprm-recipe-rating-user">'+e.user+"</span>"),t=r.trim(),t},addRatingForRecipe(e,t){let r={Accept:"application/json","Content-Type":"application/json"};return 0<parseInt(wprmp_public.user)&&(r["X-WP-Nonce"]=wprm_public.api_nonce),fetch(`${wprmp_public.endpoints.user_rating}/${t}`,{method:"POST",headers:r,credentials:"same-origin",body:JSON.stringify({data:e})}).then((r=>r.ok?r.json():window.WPRecipeMaker.userRating.addRatingForRecipeThroughAjax(e,t))).then((e=>e))},addRatingForRecipeThroughAjax:(e,t)=>fetch(wprm_public.ajax_url,{method:"POST",credentials:"same-origin",body:"action=wprm_user_rate_recipe&security="+encodeURIComponent(wprm_public.nonce)+"&recipe_id="+encodeURIComponent(t)+"&data="+encodeURIComponent(JSON.stringify(e)),headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"}}).then((e=>!!e.ok&&e.json())).then((e=>!!e.success&&e.data)),getCommentContainerElement(){let e=[".comment-form-wprm-rating","#llc_comments"];wprmp_public.settings.user_ratings_force_comment_scroll_to&&e.unshift(wprmp_public.settings.user_ratings_force_comment_scroll_to);for(let t of e){const e=document.querySelector(t);if(e)return e}return!1},canJumpToComments:()=>!!wprmp_public.settings.features_comment_ratings&&!!window.WPRecipeMaker.userRating.getCommentContainerElement(),jumpToCommentRating(e){let t=window.WPRecipeMaker.userRating.getCommentContainerElement();if(t){const r=()=>{const t=document.querySelector(".comment-form-wprm-rating");if(t){const r=t.querySelectorAll("input");for(let t of r)if(e===parseInt(t.value)){t.click();break}}const r=document.getElementById("comment");r&&r.focus()};!!wprmp_public.settings.user_ratings_force_comment_scroll_to_smooth?(0,o.A)(t,{verticalOffset:-100,speed:250}).then(r):(t.scrollIntoView({behavior:"instant"}),r())}}},function(e){"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}((()=>
1{window.WPRecipeMaker.userRating.init()}))},4123:()=>{var e;window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.checkboxes={initModern:()=>{document.addEventListener("change",(function(e){for(var t=e.target;t&&t!=this;t=t.parentNode)if(t.matches(".wprm-checkbox")){window.WPRecipeMaker.checkboxes.toggle(t,e);break}}),!1)},toggle:(e,t)=>{t.preventDefault();for(var r=e.parentNode;r&&r!=document;r=r.parentNode)if(r.matches("li")){r.classList.toggle("wprm-checkbox-is-checked");break}},initLegacy:()=>{let e="";e="checkbox"==wprmp_public.settings.template_ingredient_list_style&&"checkbox"==wprmp_public.settings.template_instruction_list_style?"li.wprm-recipe-ingredient, li.wprm-recipe-instruction":"checkbox"==wprmp_public.settings.template_ingredient_list_style?"li.wprm-recipe-ingredient":"li.wprm-recipe-instruction";const t=document.querySelectorAll(e);for(let r of t){r.classList.add("wprm-list-checkbox-container");let e=document.createElement("span");e.classList.add("wprm-list-checkbox"),r.insertBefore(e,r.firstChild)}document.addEventListener("click",(function(e){for(var t=e.target;t&&t!=this;t=t.parentNode)if(t.matches(".wprm-list-checkbox")){window.WPRecipeMaker.checkboxes.click(t,e);break}}),!1)},click:(e,t)=>{t.preventDefault();for(var r=e.parentNode;r&&r!=document;r=r.parentNode)if(r.matches(".wprm-list-checkbox-container")){e.classList.toggle("wprm-list-checkbox-checked"),r.classList.toggle("wprm-list-checkbox-checked");break}}},e=()=>{"legacy"!==wprmp_public.settings.recipe_template_mode||"checkbox"!=wprmp_public.settings.template_ingredient_list_style&&"checkbox"!=wprmp_public.settings.template_instruction_list_style||window.WPRecipeMaker.checkboxes.initLegacy(),"modern"===wprmp_public.settings.recipe_template_mode&&window.WPRecipeMaker.checkboxes.initModern()},"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)},4096:()=>{var e;window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.preventSleep={wakeLockApi:!1,wakeLock:!1,init(){if("wakeLock"in navigator&&"request"in navigator.wakeLock&&(this.wakeLockApi=navigator.wakeLock),this.wakeLockApi){const e=document.querySelectorAll(".wprm-prevent-sleep");if(0<e.length)for(let t of e){t.style.display="";t.querySelector(".wprm-prevent-sleep-checkbox").addEventListener("change",(function(e){WPRecipeMaker.preventSleep.checkboxChange(e.target)}),!1)}}},checkboxChange(e){e.checked?this.lock():this.unlock()},setCheckboxesState(e){const t=document.querySelectorAll(".wprm-prevent-sleep-checkbox");for(let r of t)r.checked=e},async lock(){try{this.wakeLock=await this.wakeLockApi.request("screen"),this.wakeLock.addEventListener("release",(e=>{this.wakeLock=!1,this.setCheckboxesState(!1)})),this.setCheckboxesState(!0)}catch(e){this.setCheckboxesState(!1)}},unlock(){this.wakeLock&&(this.wakeLock.release(),this.wakeLock=!1),this.setCheckboxesState(!1)}},e=()=>{window.WPRecipeMaker.preventSleep.init()},"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)},5095:()=>{var e;window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.privateNotes={load:()=>{document.addEventListener("click",(function(e){for(var t=e.target;t&&t!=this;t=t.parentNode)if(t.matches(".wprm-private-notes-container:not(.wprm-private-notes-container-disabled)")){window.WPRecipeMaker.privateNotes.click(t,e);break}}),!1),window.WPRecipeMaker.privateNotes.init()},init:()=>{const e=document.querySelectorAll(".wprm-private-notes-container");for(let t of e)window.WPRecipeMaker.privateNotes.showNotes(t)},currentlyEditing:!1,click:(e,t)=>{t.preventDefault(),window.WPRecipeMaker.privateNotes.startEditing(e)},startEditing:e=>{if(parseInt(e.dataset.recipe)&&!window.WPRecipeMaker.privateNotes.currentlyEditing){window.WPRecipeMaker.privateNotes.currentlyEditing=!0,e.classList.add("wprm-private-notes-editing");const t=e.querySelector("textarea"),r=t.scrollHeight<100?100:t.scrollHeight;t.style.height=r+"px",window.onbeforeunload=()=>{window.WPRecipeMaker.privateNotes.stopEditing(e)},t.addEventListener("blur",(()=>{window.WPRecipeMaker.privateNotes.stopEditing(e)}),!1),t.addEventListener("input",(()=>{const e=t.scrollHeight<100?100:t.scrollHeight;t.style.height=e+"px"}),!1),t.focus(),t.setSelectionRange(t.value.length,t.value.length)}},stopEditing:e=>{window.WPRecipeMaker.privateNotes.currentlyEditing=!1;const t=e.querySelector("textarea"),r=t.value.trim(),i=t.cloneNode(!0);t.parentNode.replaceChild(i,t),e.classList.remove("wprm-private-notes-editing");const n=parseInt(e.dataset.recipe);window.WPRecipeMaker.privateNotes.saveNotes(n,r),window.WPRecipeMaker.privateNotes.showNotes(e)},showNotes:e=>{const t=parseInt(e.dataset.recipe);if(t){const r=window.WPRecipeMaker.privateNotes.getNotes(t,e),i=e.querySelector("textarea");i&&(i.value=r),r?e.classList.add("wprm-private-notes-has-notes"):e.classList.remove("wprm-private-notes-has-notes");const n=e.querySelector(".wprm-private-notes-user");n&&(n.innerHTML=r)}},recipeNotes:{},getNotes:(e,t=!1)=>{let r="";if(window.WPRecipeMaker.privateNotes.recipeNotes.hasOwnProperty(`recipe-${e}`))return r=window.WPRecipeMaker.privateNotes.recipeNotes[`recipe-${e}`],r;if(t){const e=t.querySelector("textarea");e&&(r=e.value)}if(!r){const t=localStorage.getItem(`wprm-recipe-private-notes-${e}`);t&&(r=t)}return r},saveNotes:(e,t)=>{e&&(window.WPRecipeMaker.privateNotes.recipeNotes[`recipe-${e}`]=t,0<parseInt(wprmp_public.user)?fetch(`${wprmp_public.endpoints.private_notes}/${e}`,{method:"POST",headers:{"X-WP-Nonce":wprm_public.api_nonce,Accept:"application/json","Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({notes:t})}).then((e=>!!e.ok&&e.json())).then((r=>{!1===r?window.WPRecipeMaker.privateNotes.saveNotesInLocalStorage(e,t):window.WPRecipeMaker.privateNotes.saveNotesInLocalStorage(e,!1)})):window.WPRecipeMaker.privateNotes.saveNotesInLocalStorage(e,t))},saveNotesInLocalStorage:(e,t)=>
1{t?localStorage.setItem(`wprm-recipe-private-notes-${e}`,t):localStorage.removeItem(`wprm-recipe-private-notes-${e}`)},hideEmpty:()=>{const e=document.querySelectorAll(".wprm-private-notes-container");for(let t of e){const e=parseInt(t.dataset.recipe);if(e){if(!window.WPRecipeMaker.privateNotes.getNotes(e,t)){const e=t.previousElementSibling;e&&e.classList.contains("wprm-recipe-private-notes-header")&&e.remove(),t.remove()}}}}},e=()=>{window.WPRecipeMaker.privateNotes.load()},"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)},2359:()=>{var e;window.WPRecipeMaker=void 0===window.WPRecipeMaker?{}:window.WPRecipeMaker,window.WPRecipeMaker.userRatingModal={init(){if(wprmp_public.settings.user_ratings_open_url_parameter){if(new URLSearchParams(window.location.search).has(wprmp_public.settings.user_ratings_open_url_parameter)){const e=document.querySelectorAll(".wprm-user-rating, .wprm-recipe-user-ratings-modal");for(let t of e)if(t.dataset.hasOwnProperty("modalUid")&&t.dataset.hasOwnProperty("recipe")){const e=t.dataset.modalUid;let r=t.dataset.recipe;r=parseInt(r),r&&setTimeout((()=>{window.WPRecipeMaker.modal.open(e,{recipe:r,rating:0})}));break}}}document.addEventListener("wprm-modal-open",(e=>{"user-rating"===e.detail.type&&window.WPRecipeMaker.userRatingModal.opened(e.detail.uid,e.detail.modal,e.detail.data)})),document.addEventListener("wprm-modal-close",(e=>{"user-rating"===e.detail.type&&window.WPRecipeMaker.userRatingModal.closed(e.detail.uid,e.detail.modal,e.detail.data)})),document.addEventListener("wprm-comment-rating-change",(e=>{e.detail.hasOwnProperty("container")&&e.detail.container.classList.contains("wprm-user-ratings-modal-stars")&&window.WPRecipeMaker.userRatingModal.ratingChange(e.detail.rating)})),document.addEventListener("click",(function(e){for(var t=e.target;t&&t!=this;t=t.parentNode){if(t.matches(".wprm-cta-rating-modal")||t.matches(".wprm-recipe-user-ratings-modal")){e.preventDefault();const r=t.dataset.modalUid;let i=t.dataset.recipe;i=parseInt(i),i&&window.WPRecipeMaker.modal.open(r,{recipe:i,rating:0});break}if(t.matches(".wprm-user-rating-modal-comment-suggestion")){e.preventDefault();const r=t.innerText,i=document.querySelector(".wprm-user-rating-modal-comment");r&&i&&(i.value=r,window.WPRecipeMaker.userRatingModal.checkFields());break}if(t.matches(".wprm-user-rating-summary-details-no-comments")){e.preventDefault(),window.WPRecipeMaker.userRatingModal.ratingsWithoutCommentsPopup(t);break}}}),!1)},modalUid:!1,currentRecipe:!1,currentCommentForRecipe:{},opened(e,t,r){window.WPRecipeMaker.userRatingModal.modalUid=e,window.WPRecipeMaker.userRatingModal.setTitle(wprmp_public.settings.user_ratings_modal_title),window.WPRecipeMaker.userRatingModal.displayMessage('<div class="wprm-loader"></div>');const i=t.querySelector(".wprm-user-ratings-modal-stars-container").querySelectorAll("input");if(i[0].click(),r.hasOwnProperty("rating")){const e=parseInt(r.rating);for(let t of i)if(e===parseInt(t.value)){t.click();break}}const n=t.querySelector('input[name="wprm-user-rating-recipe-id"]');n.value=r.hasOwnProperty("recipe")?r.recipe:0,window.WPRecipeMaker.manager.getRecipe(n.value).then((e=>{window.WPRecipeMaker.userRatingModal.currentRecipe=e,window.WPRecipeMaker.userRatingModal.displayMessage(!1);const r=t.querySelector(".wprm-user-rating-modal-comment");r.value="",e&&window.WPRecipeMaker.userRatingModal.currentCommentForRecipe.hasOwnProperty(e.id)&&(r.value=window.WPRecipeMaker.userRatingModal.currentCommentForRecipe[e.id]),window.WPRecipeMaker.userRatingModal.checkFields(),window.WPRecipeMaker.userRatingModal.displayError(!1),window.WPRecipeMaker.userRatingModal.displayWaiting(!1);t.querySelector(".wprm-user-ratings-modal-recipe-name").innerHTML=e?e.data.name:""}))},ratingChange(e){window.WPRecipeMaker.userRatingModal.checkFields()},checkFields(){const e=document.querySelector(".wprm-popup-modal-user-rating"),t=0<parseInt(wprmp_public.user);t&&e.classList.add("wprm-user-rating-modal-logged-in");const r=e.querySelector(".wprm-user-rating-modal-comment"),i=e.querySelector('input[name="wprm-user-rating-name"]'),n=e.querySelector('input[name="wprm-user-rating-email"]');
1r.required=wprmp_public.settings.user_ratings_require_comment,i.required=!t&&wprmp_public.settings.user_ratings_require_name,n.required=!t&&wprmp_public.settings.user_ratings_require_email;const a=new FormData(r.form),s=Object.fromEntries(a),o=parseInt(s["wprm-user-rating-stars"]),c=e.querySelector(".wprm-user-rating-modal-comment-suggestions-container");if(c&&(c.style.display=window.WPRecipeMaker.userRatingModal.shouldSuggestionsShow(o)?"block":"none"),!wprmp_public.settings.user_ratings_require_comment){const t=e.querySelector(".wprm-user-rating-modal-submit-comment"),i=e.querySelector(".wprm-user-rating-modal-submit-no-comment");r.value?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")}},shouldSuggestionsShow(e){if("never"!==wprmp_public.settings.user_ratings_comment_suggestions_enabled){const t={always:1,"2_star":2,"3_star":3,"4_star":4,"5_star":5};if(t.hasOwnProperty(wprmp_public.settings.user_ratings_comment_suggestions_enabled)&&e>=t[wprmp_public.settings.user_ratings_comment_suggestions_enabled])return!0}return!1},submit(e){const t=new FormData(e),r=Object.fromEntries(t),i=parseInt(r["wprm-user-rating-recipe-id"]),n=parseInt(r["wprm-user-rating-stars"]),a=r["wprm-user-rating-comment"].trim(),s=r["wprm-user-rating-name"].trim(),o=r["wprm-user-rating-email"].trim();if(n<=0||n>5)return window.WPRecipeMaker.userRatingModal.displayError("rating"),!1;if(0===parseInt(wprmp_public.user)){if(!s&&wprmp_public.settings.user_ratings_require_name)return window.WPRecipeMaker.userRatingModal.displayError("name"),!1;if(!o&&wprmp_public.settings.user_ratings_require_email)return window.WPRecipeMaker.userRatingModal.displayError("email"),!1}window.WPRecipeMaker.userRatingModal.displayError(!1),window.WPRecipeMaker.userRatingModal.displayWaiting(!0);const c={post_id:wprm_public.post_id,rating:n,comment:a,name:s,email:o};window.WPRecipeMaker.manager.getRecipe(i).then((e=>{const t=e=>{let t="";t=!1===e?wprmp_public.settings.user_ratings_problem_message:wprmp_public.settings.user_ratings_thank_you_message_with_comment,t?(window.WPRecipeMaker.userRatingModal.setTitle(wprmp_public.settings.user_ratings_thank_you_title),window.WPRecipeMaker.userRatingModal.displayMessage(t)):window.WPRecipeMaker.modal.close(window.WPRecipeMaker.userRatingModal.modalUid)};e?e.addRating(c).then((e=>{window.WPRecipeMaker.userRatingModal.displayWaiting(!1),t(e)})):t(!1)}))},displayError(e){const t=document.querySelector("#wprm-user-rating-modal-errors");t&&t.querySelectorAll("div").forEach((t=>{e&&t.id==="wprm-user-rating-modal-error-"+e?t.style.display="block":t.style.display=""}))},displayWaiting(e){const t=document.querySelector("#wprm-user-rating-modal-waiting");t&&(t.style.display=e?"inline-block":"");const r=document.querySelectorAll(".wprm-user-rating-modal-submit-rating, .wprm-user-rating-modal-submit-comment");for(let i of r)i.disabled=e},displayMessage(e){const t=document.querySelector("#wprm-user-ratings-modal-stars-form"),r=document.querySelector("#wprm-user-ratings-modal-message");!1===e?(t.style.display="block",r.style.display="none"):(t.style.display="none",r.innerHTML=e,r.style.display="block")},setTitle(e){const t=document.querySelector("#wprm-popup-modal-user-rating-title");t&&e&&(t.innerHTML=e)},closed(e,t,r){const i=window.WPRecipeMaker.userRatingModal.currentRecipe;if(i){let e="";if("none"!==document.querySelector("#wprm-user-ratings-modal-stars-form").style.display){e=t.querySelector(".wprm-user-rating-modal-comment").value}window.WPRecipeMaker.userRatingModal.currentCommentForRecipe[i.id]=e}window.WPRecipeMaker.userRatingModal.currentRecipe=!1,window.WPRecipeMaker.userRatingModal.modalUid=!1},ratingsWithoutCommentsPopup(e){const t=e.dataset.modalUid;if(t){const r=document.getElementById("wprm-popup-modal-"+t);window.WPRecipeMaker.modal.open(t);const i=r.querySelector(".wprm-loader"),n=r.querySelector(".wprm-popup-modal-user-rating-summary-error"),a=r.querySelector(".wprm-popup-modal-user-rating-summary-ratings");i.style.display="block",n.style.display="none",a.innerHTML="";const s=e.dataset.recipeId,o=e.dataset.postId;let c={Accept:"application/json","Content-Type":"application/json"};return 0<parseInt(wprmp_public.user)&&(c["X-WP-Nonce"]=wprm_public.api_nonce),fetch(`${wprmp_public.endpoints.user_rating}/summary-popup`,{method:"POST",headers:c,credentials:"same-origin",body:JSON.stringify({recipeId:s,postId:o})}).then((e=>!!e.ok&&e.json())).then((e=>{i.style.display="none",e&&e.html?a.innerHTML=e.html:n.style.display="block"}))}}},e=()=>{window.WPRecipeMaker.userRatingModal.init()},"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)},2687:(e,t,r)=>{"use strict";r.d(t,{L:()=>o,V:()=>s});var i=r(2667),n=r.n(i);const a={"¼":"1/4","½":"1/2","¾":"3/4","â
":"1/7","â
":"1/9","â
":"1/10","â
":"1/3","â
":"2/3","â
":"1/5","â
":"2/5","â
":"3/5","â
":"4/5","â
":"1/6","â
":"5/6","â
":"1/8","â
":"3/8","â
":"5/8","â
":"7/8"};function s(e,t=2,r=!1){const i=void 0!==window.wprmp_public?wprmp_public.settings.decimal_separator:wprmp_admin.settings.decimal_separator,s="c
1omma"===i?",":".",o="comma"===i?".":",";let c=e,p=!1;if(r){if(void 0!==window.wprmp_public?wprmp_public.settings.fractions_enabled:wprmp_admin.settings.fractions_enabled){const t=void 0!==window.wprmp_public?wprmp_public.settings.fractions_use_mixed:wprmp_admin.settings.fractions_use_mixed,r=void 0!==window.wprmp_public?wprmp_public.settings.fractions_use_symbols:wprmp_admin.settings.fractions_use_symbols;let i=parseInt(void 0!==window.wprmp_public?wprmp_public.settings.fractions_max_denominator:wprmp_admin.settings.fractions_max_denominator);i=i>1?i:8;const s=n()(e,i,t);if(s&&3===s.length&&!isNaN(s[0])&&!isNaN(s[1])&&!isNaN(s[2])){let e="";if(0<s[0]&&(e+=`${s[0]} `,e=e.replace(/\B(?=(\d{3})+(?!\d))/g,o)),0<s[1]?0<s[2]&&(e+=1===s[2]?s[1]:`${s[1]}/${s[2]}`):0===s[0]&&(e+=`1/${i}`),e){if(r){e=" "+e+" ";for(let t of Object.keys(a)){const r=a[t];e=e.replace(` ${r} `,` ${t} `)}}c=e.trim(),p=!0}}}}if(!p){t=parseInt(t),(isNaN(t)||t<0)&&(t=0);do{if(c=parseFloat(parseFloat(e).toFixed(t)),3<++t)break}while(0==c);c=""+c,"comma"===i&&(c=c.replace(".",","));const r=c.split(s);r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,o),c=r.join(s)}return c}function o(e){const t="number"==typeof e;if(e=""+e,!t){if("comma"===(void 0!==window.wprmp_public?wprmp_public.settings.decimal_separator:wprmp_admin.settings.decimal_separator)){const t=e.indexOf(".");if(-1!==t&&e.length-t>3){const r=e.substr(0,t);0!==parseInt(r)&&(e=e.replace(".",""))}}else{const t=e.indexOf(",");if(-1!==t&&e.length-t>3){const r=e.substr(0,t);0!==parseInt(r)&&(e=e.replace(",",""))}}}var r=(e=(e=(e=(e=(e=((e=(e=(e=(e=(e=e.replace(",",".")).replace(" to ","-")).replace("â","-")).replace("â","-")).replace(" - ","-"))+"").replace(/(\u00BC|\u00BD|\u00BE|\u2150|\u2151|\u2152|\u2153|\u2154|\u2155|\u2156|\u2157|\u2158|\u2159|\u215A|\u215B|\u215C|\u215D|\u215E)/,(function(e,t){return" "+a[t]+" "}))).replace(/(<([^>]+)>)/gi,"")).replace(/(\[([^\]]+)\])/gi,"")).replace(/[^\d\s\.\/-]/gi,"")).trim()).split(" "),i=!1;if(""!==e){i=0;for(var n=0;n<r.length;n++)if(""!==r[n].trim()){var s=r[n].split("/",2),o=parseFloat(s[0]);if(void 0!==s[1]){var c=parseFloat(s[1]);0!==c&&(o/=c)}isNaN(o)||(i+=o)}}return i}},942:(e,t,r)=>{"use strict";r.d(t,{f:()=>n});let i={};function n(e,t="wp-recipe-maker"){return i.hasOwnProperty(e)?i[e]:e}window.hasOwnProperty("wprm_public")&&wprm_public.hasOwnProperty("translations")&&(i={...i,...wprm_public.translations}),window.hasOwnProperty("wprm_admin")&&wprm_admin.hasOwnProperty("translations")&&(i={...i,...wprm_admin.translations})},2667:e=>{var t=function(e,t,r){var i=Math.floor(e),n=1,a=i+1,s=1;if(e!==i)for(;n<=t&&s<=t;){var o=(i+a)/(n+s);if(e===o){n+s<=t?(n+=s,i+=a,s=t+1):n>s?s=t+1:n=t+1;break}e<o?(a=i+a,s=n+s):(i+=a,n+=s)}if(n>t&&(n=s,i=a),!r)return[0,i,n];var c=Math.floor(i/n);return[c,i-c*n,n]};t.cont=function(e,t,r){for(var i=e<0?-1:1,n=e*i,a=0,s=1,o=0,c=1,p=0,d=0,l=Math.floor(n);p<t&&(o=(l=Math.floor(n))*s+a,d=l*p+c,!(n-l<5e-8));)n=1/(n-l),a=s,s=o,c=p,p=d;if(d>t&&(p>t?(d=c,o=a):(d=p,o=s)),!r)return[0,i*o,d];var m=Math.floor(i*o/d);return[m,i*o-m*d,d]},"undefined"==typeof DO_NOT_EXPORT_FRAC&&(e.exports=t)}},e=>{var t,r=(t=150,e(e.s=t));(WPRecipeMaker=void 0===WPRecipeMaker?{}:WPRecipeMaker)["wp-recipe-maker-premium/dist/public-pro"]=r}]);
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.