(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[584],{2424:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/recipes/[id]",function(){return n(8360)}])},8360:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return o}});var i=n(5893),s=n(9008),a=n.n(s),c=n(3300),r=n.n(c);function getFraction(e){let t=e.toString().split(".");if(1==t.length)return e;var n=[];parseInt(t[0])>0&&n.push(parseInt(t[0]));let i=parseFloat("0.".concat(t[1]));return .125==i&&n.push("⅛"),.25==i&&n.push("\xbc"),.33==i&&n.push("⅓"),.5==i&&n.push("\xbd"),.66==i&&n.push("⅔"),.75==i&&n.push("\xbe"),n.join(" ")}function getTime(e){if(-1!=Math.sign(e)){var t=e%60,n=Math.floor(e/60),i=Math.floor(n/24),n=n%24,s=[];return i>0&&s.push("".concat(i," day").concat(1==i?"":"s")),n>0&&s.push("".concat(n," hr").concat(1==n?"":"s")),t>0&&s.push("".concat(t," min").concat(1==t?"":"s")),s.join(" ")}var a=Math.abs(e),t=a%60,n=Math.floor(a/60),i=Math.floor(n/24),n=n%24,s=[];return i>0&&s.push("".concat(i," day").concat(1==i?"":"s")),n>0&&s.push("".concat(n," hr").concat(1==n?"":"s")),t>0&&s.push("".concat(t," min").concat(1==t?"":"s")),s.join(" ")}var o=!0;t.default=function(e){var t,n,s,c;let o,{data:p}=e,u=p.data.recipe,l=JSON.parse(u),d=p.data.image,h=p.data.title;o=null!=d&&void 0!=d?d.replace("${f}","image.png"):"";let m="app-id=1461650987, app-argument=https://recipes.crouton.app/viewSharedRecipe?id=".concat(l.uuid);return null==u||void 0==u?(0,i.jsx)("div",{children:"Recipe not found"}):(0,i.jsxs)("div",{children:[(0,i.jsxs)(a(),{children:[(0,i.jsx)("title",{children:h},"title"),(0,i.jsx)("meta",{name:"keywords",content:"crouton, recipes, ".concat(h)},"keywords"),(0,i.jsx)("meta",{name:"description",content:h},"description"),(0,i.jsx)("meta",{property:"og:title",content:h},"og:title"),(0,i.jsx)("meta",{property:"og:description",content:h},"og:description"),(0,i.jsx)("meta",{property:"og:image",content:o}),(0,i.jsx)("meta",{property:"og:type",content:"article"}),(0,i.jsx)("meta",{property:"og:url",content:"https://crouton.app"},"og:url"),(0,i.jsx)("meta",{name:"twitter:title",content:h},"twitter-title"),(0,i.jsx)("meta",{name:"twitter:description",content:h},"twitter-description"),(0,i.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,i.jsx)("meta",{name:"twitter:site",content:"@_CroutonApp"}),(0,i.jsx)("meta",{name:"twitter:image",content:o}),(0,i.jsx)("meta",{name:"apple-itunes-app",content:m}),(0,i.jsx)("meta",{name:"author",content:"Crouton"})]}),null!=l.webLink&&void 0!=l.webLink&&""!=l.webLink?null:(0,i.jsxs)("div",{className:r().recipeContent,children:[(0,i.jsxs)("div",{className:r().title,children:[(0,i.jsxs)("h1",{className:r().recipeName,children:[" ",h," "]}),null!=l.webLink&&void 0!=l.webLink&&(0,i.jsx)("div",{className:r().sourceView,children:(0,i.jsx)("a",{href:l.webLink.includes("http")?l.webLink:"https://"+l.webLink,target:"_blank",children:null==l.sourceName?l.webLink:l.sourceName})}),(0,i.jsx)("div",{className:r().gradient}),null!=p.data.image&&void 0!=p.data.image&&(0,i.jsx)("img",{src:p.data.image,alt:"recipe hero image",className:r().headerImage})]}),(s=l.serves,((c=[]).push((0,i.jsxs)("div",{className:r().servings,children:[(0,i.jsx)("img",{src:"/person.png",className:r().personImage}),s]})),null!=l.duration&&void 0!=l.duration&&l.duration>0&&(t=getTime(l.duration),c.push((0,i.jsxs)("div",{className:r().prepTime,children:[(0,i.jsx)("img",{src:"/clock.png",className:r().clockImage}),"Prep ",t]}))),null!=l.cookingDuration&&void 0!=l.cookingDuration&&l.cookingDuration>0&&(n=getTime(l.cookingDuration),c.push((0,i.jsxs)("div",{className:r().cookTime,children:[(0,i.jsx)("img",{src:"/clock.png",className:r().clockImage}),"Cook ",n]}))),null!=s||null!=t||null!=n)?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:r().detailHolder,children:c.map(e=>e)})}):null),l.ingredients.length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:r().header,children:"Ingredients"}),(0,i.jsx)("div",{className:r().ingredients,children:l.ingredients.map((e,t)=>{var n;return(0,i.jsxs)("div",{className:r().ingredient,children:[null!=e.quantity&&"SECTION"==e.quantity.quantityType&&t>0&&(0,i.jsx)("br",{}),(0,i.jsx)("span",{className:r().ingredientQuantity,children:function(e){var t=[];if(null!=e.quantity&&void 0!=e.quantity){let n=!1;switch(e.quantity.quantityType){case"TABLESPOON":case"TEASPOON":case"CUP":case"OUNCE":case"FLUID_OUNCE":t.push(getFraction(e.quantity.amount)),n=1!=e.quantity.amount,null!=e.quantity.secondaryAmount&&(n=1!=e.quantity.secondaryAmount,t.push("- "+getFraction(e.quantity.secondaryAmount)));break;case"RECIPE":break;default:t.push(e.quantity.amount),null!=e.quantity.secondaryAmount&&t.push("- "+e.quantity.secondaryAmount)}switch(e.quantity.quantityType){case"TABLESPOON":t.push("Tbsp");break;case"TEASPOON":t.push("tsp");break;case"CUP":n?t.push("cups"):t.push("cup");break;case"MILLS":n?t.push("mls"):t.push("ml");break;case"GRAMS":t.push("g");break;case"ITEM":break;case"LITRES":n?t.push("litres"):t.push("litre");break;case"KGS":t.push("kg");break;case"POUND":n?t.push("pounds"):t.push("pound");break;case"OUNCE":n?t.push("ounces"):t.push("ounce");break;case"FLUID_OUNCE":n?t.push("fluid ounces"):t.push("fluid ounce");break;case"BUNCH":n?t.push("bunches"):t.push("bunch");break;case"CAN":n?t.push("cans"):t.push("can"),t.push("can");break;case"PACKET":n?t.push("packets"):t.push("packet");break;case"BOTTLE":n?t.push("bottles"):t.push("bottle");break;case"SECTION":t=[];break;case"PINCH":n?t.push("pinches"):t.push("pinch");break;case"DECILITER":t.push("dl")}}return t.length>0?(t.push(""),t.join(" ")):""}(e)}),((n=[]).push(e.ingredient.name),null!=e.quantity&&void 0!=e.quantity&&"SECTION"==e.quantity.quantityType)?(0,i.jsx)("div",{className:r().ingredientSection,children:n.join(" ")}):(0,i.jsx)("span",{children:n.join(" ")})]},e.uuid)})})]}),l.steps.length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:r().header,children:"Steps"}),(0,i.jsx)("div",{className:r().method,children:l.steps.map(e=>e.isSection?(0,i.jsx)("div",{className:r().stepSection,children:e.step},e.uuid):(0,i.jsxs)("div",{className:r().step,children:[(0,i.jsx)("div",{className:r().counter,children:e.order+1}),e.step]},e.uuid))})]}),null!=l.notes&&void 0!=l.notes?(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:r().header,children:"Notes"}),(0,i.jsx)("div",{className:r().notes,children:l.notes})]}):null,null!=l.nutrition&&void 0!=l.nutrition?(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:r().header,children:"Nutrition"}),(0,i.jsx)("div",{className:r().nutrition,children:l.nutrition})]}):null]}),function(e){if(null==e||void 0==e)return null;{let t="2; url='"+(e.includes("http")?e:"https://"+e)+"'";return(0,i.jsxs)("div",{className:r().redirect,children:[(0,i.jsx)("div",{className:r().overlayCard,children:(0,i.jsxs)("div",{className:r().overlayCardContent,children:[(0,i.jsx)("div",{className:r().iconWrapper,children:(0,i.jsx)("img",{src:"/web.png",className:r().appicon})}),(0,i.jsx)("div",{className:r().redirectTitle,children:"Shared with Crouton"}),(0,i.jsx)("a",{className:r().appstoreLink,href:"https://apps.apple.com/app/crouton/id1461650987",children:(0,i.jsx)("img",{src:"/appstore.svg",alt:"Download from the App Store"})}),(0,i.jsx)("div",{className:r().redirectText,children:"Redirecting..."})]})}),(0,i.jsx)("meta",{httpEquiv:"Refresh",content:t})]})}}(l.webLink)]})}},3300:function(e){e.exports={recipeContent:"Recipe_recipeContent__ubxDO",ingredients:"Recipe_ingredients__3AYot",ingredient:"Recipe_ingredient__VMciM",ingredientQuantity:"Recipe_ingredientQuantity__BR6fr",ingredientSection:"Recipe_ingredientSection__d9_4x",method:"Recipe_method__KsMMW",stepSection:"Recipe_stepSection__RmrAv",step:"Recipe_step__6_VY2",counter:"Recipe_counter__U5tNC",recipeName:"Recipe_recipeName__pNimN",sourceView:"Recipe_sourceView__xZ35a",title:"Recipe_title__EuAw7",gradient:"Recipe_gradient__ANe5w",headerImage:"Recipe_headerImage__YFXzb",detailHolder:"Recipe_detailHolder__aBSCc",prepTime:"Recipe_prepTime__qVOUf",servings:"Recipe_servings__vMeuU",cookTime:"Recipe_cookTime__q9wbG",notes:"Recipe_notes__pSkx6",nutrition:"Recipe_nutrition__FnEfO",header:"Recipe_header__TaS1U",redirect:"Recipe_redirect__3NOVN",overlayCard:"Recipe_overlayCard__TG6dR",overlayCardContent:"Recipe_overlayCardContent__gCRp4",redirectTitle:"Recipe_redirectTitle__OQRMS",redirectText:"Recipe_redirectText__OIxUO",iconWrapper:"Recipe_iconWrapper__6LlM1",appicon:"Recipe_appicon__p0U9_",appstoreLink:"Recipe_appstoreLink__zVx_Z"}},9008:function(e,t,n){e.exports=n(9201)}},function(e){e.O(0,[774,888,179],function(){return e(e.s=2424)}),_N_E=e.O()}]);