diff --git a/assets/IngredientGalleryItem-ZncCOUle.js b/assets/IngredientGalleryItem-D5n1mWkc.js similarity index 94% rename from assets/IngredientGalleryItem-ZncCOUle.js rename to assets/IngredientGalleryItem-D5n1mWkc.js index d95a1be..63bfcc0 100644 --- a/assets/IngredientGalleryItem-ZncCOUle.js +++ b/assets/IngredientGalleryItem-D5n1mWkc.js @@ -1 +1 @@ -import{u as a,a as u,j as s,s as m,h as x,F as g,f,b as o,c as h}from"./index-Bxub-4hb.js";function w({item:c}){const{itemName:e}=c,l=a(t=>t.groups.ingredientsGroups),r=a(t=>t.recipe.currentGroupName),n=u(),d=()=>{var t;if(!r)n(o("Ingredient group cannot be empty"));else{const p=(t=l.filter(i=>i.groupName===r)[0])==null?void 0:t.items.filter(i=>i.itemName===e)[0];n(p?o("Ingredient is already in the group!"):h({groupName:r,itemName:e}))}};return s.jsx("div",{className:"flex flex-row","data-testid":`${e}_gallery`,children:s.jsxs("div",{className:"relative flex flex-col print-rounded card-shadow w-cw aspect-videoReverse",children:[s.jsx("img",{src:`${m}/assets/ingredients/${e.toLowerCase()}.webp`,alt:e,className:"print-rounded-img"}),s.jsx("div",{className:"absolute inset-0 flex center bg-white print-rounded bg-opacity-70 opacity-0 hover:opacity-100 hover:cursor-pointer transition-opacity",onClick:()=>d(),onKeyDown:x,children:s.jsx(g,{icon:f,className:"cursor-pointer text-4xl text-green-600"})}),s.jsx("p",{className:"flex flex-grow rounded-b-2xl center px-4 text-center text-fluidPrintTitle",children:e})]})})}export{w as default}; +import{u as a,a as u,j as s,s as m,h as x,F as g,f,b as o,c as h}from"./index-XM5a2Hj3.js";function w({item:c}){const{itemName:e}=c,l=a(t=>t.groups.ingredientsGroups),r=a(t=>t.recipe.currentGroupName),n=u(),d=()=>{var t;if(!r)n(o("Ingredient group cannot be empty"));else{const p=(t=l.filter(i=>i.groupName===r)[0])==null?void 0:t.items.filter(i=>i.itemName===e)[0];n(p?o("Ingredient is already in the group!"):h({groupName:r,itemName:e}))}};return s.jsx("div",{className:"flex flex-row","data-testid":`${e}_gallery`,children:s.jsxs("div",{className:"relative flex flex-col print-rounded card-shadow w-cw aspect-videoReverse",children:[s.jsx("img",{src:`${m}/assets/ingredients/${e.toLowerCase()}.webp`,alt:e,className:"print-rounded-img"}),s.jsx("div",{className:"absolute inset-0 flex center bg-white print-rounded bg-opacity-70 opacity-0 hover:opacity-100 hover:cursor-pointer transition-opacity",onClick:()=>d(),onKeyDown:x,children:s.jsx(g,{icon:f,className:"cursor-pointer text-4xl text-green-600"})}),s.jsx("p",{className:"flex flex-grow rounded-b-2xl center px-4 text-center text-fluidPrintTitle",children:e})]})})}export{w as default}; diff --git a/assets/index-Bxub-4hb.js b/assets/index-XM5a2Hj3.js similarity index 99% rename from assets/index-Bxub-4hb.js rename to assets/index-XM5a2Hj3.js index 7f4c07a..a255b6a 100644 --- a/assets/index-Bxub-4hb.js +++ b/assets/index-XM5a2Hj3.js @@ -99,7 +99,7 @@ __p += '`),je&&(q+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+q+`return __p -}`;var Re=l1(function(){return $e(w,fe+"return "+q).apply(n,O)});if(Re.source=q,Ip(Re))throw Re;return Re}function IP(i){return Be(i).toLowerCase()}function AP(i){return Be(i).toUpperCase()}function DP(i,a,u){if(i=Be(i),i&&(u||a===n))return vy(i);if(!i||!(a=Un(a)))return i;var d=Er(i),g=Er(a),w=gy(d,g),O=yy(d,g)+1;return Ki(d,w,O).join("")}function LP(i,a,u){if(i=Be(i),i&&(u||a===n))return i.slice(0,xy(i)+1);if(!i||!(a=Un(a)))return i;var d=Er(i),g=yy(d,Er(a))+1;return Ki(d,0,g).join("")}function MP(i,a,u){if(i=Be(i),i&&(u||a===n))return i.replace(ye,"");if(!i||!(a=Un(a)))return i;var d=Er(i),g=gy(d,Er(a));return Ki(d,g).join("")}function jP(i,a){var u=K,d=Z;if(pt(a)){var g="separator"in a?a.separator:g;u="length"in a?ke(a.length):u,d="omission"in a?Un(a.omission):d}i=Be(i);var w=i.length;if(_a(i)){var O=Er(i);w=O.length}if(u>=w)return i;var P=u-Ea(d);if(P<1)return d;var L=O?Ki(O,0,P).join(""):i.slice(0,P);if(g===n)return L+d;if(O&&(P+=L.length-P),Ap(g)){if(i.slice(P).search(g)){var Y,V=L;for(g.global||(g=qd(g.source,Be(ii.exec(g))+"g")),g.lastIndex=0;Y=g.exec(V);)var q=Y.index;L=L.slice(0,q===n?P:q)}}else if(i.indexOf(Un(g),P)!=P){var re=L.lastIndexOf(g);re>-1&&(L=L.slice(0,re))}return L+d}function FP(i){return i=Be(i),i&&Ut.test(i)?i.replace(dt,pC):i}var zP=Ta(function(i,a,u){return i+(u?" ":"")+a.toUpperCase()}),Mp=s0("toUpperCase");function a1(i,a,u){return i=Be(i),a=u?n:a,a===n?sC(i)?vC(i):JE(i):i.match(a)||[]}var l1=Pe(function(i,a){try{return Fn(i,n,a)}catch(u){return Ip(u)?u:new _e(u)}}),UP=ui(function(i,a){return or(a,function(u){u=Vr(u),li(i,u,Pp(i[u],i))}),i});function $P(i){var a=i==null?0:i.length,u=ve();return i=a?ut(i,function(d){if(typeof d[1]!="function")throw new ar(s);return[u(d[0]),d[1]]}):[],Pe(function(d){for(var g=-1;++gz)return[];var u=ae,d=on(i,ae);a=ve(a),i-=ae;for(var g=Kd(d,a);++u0||a<0)?new Le(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),a!==n&&(a=ke(a),u=a<0?u.dropRight(-a):u.take(a-i)),u)},Le.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Le.prototype.toArray=function(){return this.take(ae)},Kr(Le.prototype,function(i,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),d=/^(?:head|last)$/.test(a),g=y[d?"take"+(a=="last"?"Right":""):a],w=d||/^find/.test(a);g&&(y.prototype[a]=function(){var O=this.__wrapped__,P=d?[1]:arguments,L=O instanceof Le,Y=P[0],V=L||Ce(O),q=function(Te){var je=g.apply(y,Ui([Te],P));return d&&re?je[0]:je};V&&u&&typeof Y=="function"&&Y.length!=1&&(L=V=!1);var re=this.__chain__,fe=!!this.__actions__.length,we=w&&!re,Re=L&&!fe;if(!w&&V){O=Re?O:new Le(this);var xe=i.apply(O,P);return xe.__actions__.push({func:ec,args:[q],thisArg:n}),new lr(xe,re)}return we&&Re?i.apply(this,P):(xe=this.thru(q),we?d?xe.value()[0]:xe.value():xe)})}),or(["pop","push","shift","sort","splice","unshift"],function(i){var a=Nu[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);y.prototype[i]=function(){var g=arguments;if(d&&!this.__chain__){var w=this.value();return a.apply(Ce(w)?w:[],g)}return this[u](function(O){return a.apply(Ce(O)?O:[],g)})}}),Kr(Le.prototype,function(i,a){var u=y[a];if(u){var d=u.name+"";Ke.call(Ra,d)||(Ra[d]=[]),Ra[d].push({name:a,func:u})}}),Ra[Yu(n,_).name]=[{name:"wrapper",func:n}],Le.prototype.clone=FC,Le.prototype.reverse=zC,Le.prototype.value=UC,y.prototype.at=mR,y.prototype.chain=vR,y.prototype.commit=gR,y.prototype.next=yR,y.prototype.plant=xR,y.prototype.reverse=bR,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=SR,y.prototype.first=y.prototype.head,Al&&(y.prototype[Al]=wR),y},Ca=gC();Io?((Io.exports=Ca)._=Ca,Fd._=Ca):Vt._=Ca}).call(Yl)})(Df,Df.exports);var Go=Df.exports;const rL={chefInstructions:[],currentInstruction:null,availableItems:[]},H_=yd({name:"chefActions",initialState:rL,reducers:{resetChefInstructions:e=>{e.chefInstructions=[]},setCustomInstructionItem:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);n&&(n.customItem=t.payload.customItem)},addChefInstruction:(e,t)=>{e.chefInstructions.push(t.payload)},removeChefInstruction:(e,t)=>{e.chefInstructions.find(r=>Go.isEqual(r,t.payload))&&(e.chefInstructions=e.chefInstructions.filter(r=>!Go.isEqual(r,t.payload)))},updateChefInstructionItems:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);if(n){const r={...n,items:t.payload.items};e.chefInstructions=e.chefInstructions.filter(o=>!Go.isEqual(o,n)),e.chefInstructions.push(r)}},updateInstructionTime:(e,t)=>{const{instruction:n,time:r}=t.payload,o=e.chefInstructions.find(l=>Go.isEqual(l,n));o&&(o.action.time=r)},updateInstructionAction:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);n&&(n.action=t.payload.action)},updateInstructionNote:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);n&&(n.note=t.payload.note)},setAvailableItems:(e,t)=>{e.availableItems=t.payload},updateAvailableItem:(e,t)=>{const n=e.availableItems.findIndex(r=>Go.isEqual(r,t.payload));n===-1?e.availableItems.push(t.payload):e.availableItems.splice(n,1)},updateAvailableItems:(e,t)=>{e.availableItems.push(...t.payload)}}}),{resetChefInstructions:iL,setCustomInstructionItem:oL,addChefInstruction:aL,removeChefInstruction:lL,updateChefInstructionItems:G_,updateInstructionTime:sL,updateInstructionAction:uL,updateInstructionNote:kc,setAvailableItems:cL,updateAvailableItem:hg,updateAvailableItems:fL}=H_.actions,dL=H_.reducer;function ua({page:e,isNext:t}){const n=sg(),r=wn(),o=He(p=>p.recipe.title),l=He(p=>p.groups.ingredientsGroups),s=He(p=>p.actions.chefInstructions),c=async()=>{const p=l.flatMap(S=>S.items.flat()),m=p.every(S=>S.amount>0),v=p.every(S=>S.unit!==vl);return m&&v},f=async()=>{const p=s.every(v=>v.items.length>0||v.customItem),m=s.every(v=>v.action.time!==0);return s.length>0&&p&&m},h=async()=>{if(t){let p=!1,m="";if(e==="/quantities"&&(o.length>0&&l.length>0?p=!0:m="You must have a Recipe Title and ingredients!"),e==="/instructions")if(await c()){p=!0;const v=l.flatMap(S=>S.items.flat());r(cL(v))}else m="Fill in all quantities and units!";(e==="/print"||e==="/doublePrint")&&(await f()?p=!0:m="Create some instructions with ingredients!"),p?(r(Lr("")),n(e)):r(Lr(m))}else r(Lr("")),n(e,{replace:!0})};return x.jsx("div",{"data-testid":t?"next":"back",onKeyDown:Pi,onClick:h,children:t?x.jsx("button",{className:"go-to-button-arrow right-0 bg-green-500 hover:bg-green-400 hover:translate-x-4",type:"button",children:"NEXT"}):x.jsx("button",{className:"go-to-button-arrow left-0 bg-red-500 hover:bg-red-400 hover:-translate-x-4",type:"button",children:"BACK"})})}function K_(){return x.jsx("div",{"data-testid":"print",onKeyDown:Pi,onClick:()=>console.log("here"),children:x.jsxs("button",{type:"button",className:"print-to-a4-button",children:["PRINT",x.jsx("br",{}),"TO A4"]})})}const no=["All-purpose flour","Almond flour","Almond milk","Apples","Artichoke","Asparagus","Avocado","Bacon","Baguette","Baking powder","Baking soda","Banana","Barley","Basil","Bay leaves","Beans","Bean sprouts","Beets","Black beans","Black-eyed peas","Black olives","Black pepper","Blueberries","Bread","Bread buns","Bread crumbs","Bread flour","Broccoli","Brown butter","Brown lentils","Brown rice","Brown sugar","Brussels sprouts","Butter","Buttermilk","Cabbage","Cake flour","Candied ginger","Carrots","Cashew nuts","Cauliflower","Celery","Cheddar cheese","Cherries","Chia seeds","Chicken breasts","Chicken broth","Chickpeas","Chili powder","Cilantro","Cinnamon","Cloves","Cocoa nibs","Cocoa powder","Coconut milk","Coconut oil","Condensed milk","Cornmeal","Cornstarch","Corn syrup","Couscous","Cranberries","Cream cheese","Cumin","Dark chocolate","Dill","Eggs","Eggwhite","Fennel","Feta cheese","Fish sauce","Garlic","Gelatin","Ginger","Goat cheese","Grapes","Graham crackers","Greek yogurt","Green beans","Green lentils","Green olives","Ground beef","Ham","Hazelnuts","Heavy cream","Honey","Hot sauce","Kale","Ketchup","Leek","Lemon","Lemon juice","Lemon zest","Lentils","Lima beans","Lime","Macadamia nuts","Maple syrup","Marzipan","Mayonnaise","Milk","Molasses","Mozzarella cheese","Mung beans","Mushrooms","Mustard","Nutmeg","Oats","Olive oil","Onion","Orange","Oregano","Paprika","Parmesan cheese","Parsley","Pasta","Peas","Pecan flour","Pecans","Pecorino cheese","Pineapple","Pine nuts","Poppy seeds","Pork chop","Potatoes","Powdered sugar","Quinoa","Raisins","Raspberries","Red Bell Pepper","Red pepper flakes","Rice","Ricotta cheese","Rosemary","Salmon","Salt","Sausage","Seasoning","Shortening","Sliced bread","Sour cream","Soy sauce","Spinach","Sugar","Swiss cheese","Thyme","Tomato paste","Tomato sauce","Turkey","Vanilla bean","Vanilla extract","Vanilla sugar","Vegetable oil","Vinegar","Water","Walnuts","White chocolate","Whole wheat flour","Yeast","Yellow Bell Pepper","Yogurt","Yolk","Zucchini"],Rc=["mg","g","kg","ml","liter","whole","quart","pint","lbs","oz","tsp","tbsp","cup","can"],Jw=[vl,"gallon","piece","slice","strip","drop","dash","smidgen","bunch","jar","stick","clove","head","fillet","block","sheet","pack","packet","bag","bar","cube","handful","bottle","sprig","stalk","ear","bowl","scoop","dozen","pinch"],pL=[{actionName:"Add",time:-1,unit:"min",equipment:"hand"},{actionName:"Bake",time:20,unit:"min",equipment:"oven"},{actionName:"Blanch",time:1,unit:"min",equipment:"stove"},{actionName:"Blend",time:-1,unit:"min",equipment:"blender"},{actionName:"Boil",time:5,unit:"min",equipment:"stove"},{actionName:"Braise",time:10,unit:"min",equipment:"oven"},{actionName:"Broil",time:20,unit:"min",equipment:"broiler"},{actionName:"Chill",time:5,unit:"min",equipment:"hand"},{actionName:"Chop",time:-1,unit:"min",equipment:"knife"},{actionName:"Core",time:-1,unit:"min",equipment:"corer"},{actionName:"Cure",time:5,unit:"hours",equipment:"refrigerator"},{actionName:"Dice",time:-1,unit:"min",equipment:"knife"},{actionName:"Dress",time:-1,unit:"min",equipment:"none"},{actionName:"Emulsify",time:-1,unit:"min",equipment:"blender"},{actionName:"Fold",time:-1,unit:"min",equipment:"spatula"},{actionName:"Ferment",time:24,unit:"hours",equipment:"refrigerator"},{actionName:"Fry",time:5,unit:"min",equipment:"stove"},{actionName:"Garnish",time:-1,unit:"min",equipment:"none"},{actionName:"Glaze",time:-1,unit:"min",equipment:"brush"},{actionName:"Grate",time:-1,unit:"min",equipment:"grater"},{actionName:"Grill",time:20,unit:"min",equipment:"grill"},{actionName:"Infuse",time:-1,unit:"min",equipment:"stove"},{actionName:"Knead",time:10,unit:"min",equipment:"stand mixer"},{actionName:"Marinate",time:8,unit:"hours",equipment:"refrigerator"},{actionName:"Mince",time:-1,unit:"min",equipment:"knife"},{actionName:"Mix",time:-1,unit:"min",equipment:"bowl"},{actionName:"Peel",time:-1,unit:"min",equipment:"peeler"},{actionName:"Poach",time:8,unit:"min",equipment:"stove"},{actionName:"Purée",time:-1,unit:"min",equipment:"food processor"},{actionName:"Roast",time:20,unit:"min",equipment:"oven"},{actionName:"Sauté",time:5,unit:"min",equipment:"stove"},{actionName:"Score",time:-1,unit:"min",equipment:"knife"},{actionName:"Sear",time:2,unit:"min",equipment:"stove"},{actionName:"Season",time:-1,unit:"min",equipment:"none"},{actionName:"Shred",time:-1,unit:"min",equipment:"grater"},{actionName:"Sieve",time:-1,unit:"min",equipment:"sieve"},{actionName:"Simmer",time:30,unit:"min",equipment:"stove"},{actionName:"Slice",time:-1,unit:"min",equipment:"knife"},{actionName:"Smoke",time:2,unit:"hours",equipment:"smoker"},{actionName:"Steam",time:10,unit:"min",equipment:"steamer"},{actionName:"Stew",time:45,unit:"min",equipment:"slow cooker"},{actionName:"Strain",time:-1,unit:"min",equipment:"strainer"},{actionName:"Toast",time:2,unit:"min",equipment:"toaster"},{actionName:"Trim",time:-1,unit:"min",equipment:"knife"},{actionName:"Warm",time:5,unit:"min",equipment:"hand"},{actionName:"Whisk",time:5,unit:"min",equipment:"hand mixer"}],hL={title:"",currentItem:"",currentGroupName:"",possibleItems:no,batches:1,invalidState:!1},Y_=yd({name:"recipe",initialState:hL,reducers:{resetRecipe:e=>{e.title="",e.currentItem="",e.currentGroupName="",e.possibleItems=no,e.batches=1,e.invalidState=!1},toggleInvalidState:e=>{e.invalidState=!e.invalidState},nameRecipe:(e,t)=>{e.title=t.payload},nameGroup:(e,t)=>{e.currentGroupName=t.payload},setItem:(e,t)=>{e.currentItem=t.payload},updatePossibleItems:(e,t)=>{e.possibleItems=no.filter(n=>n.toLowerCase().includes(t.payload.toLowerCase()))},setBatches:(e,t)=>{e.batches=t.payload}}}),{nameRecipe:mL,nameGroup:V_,setItem:vL,updatePossibleItems:gL,setBatches:Q6,resetRecipe:q_,toggleInvalidState:Z6}=Y_.actions,yL=Y_.reducer,wL={ingredientsGroups:[]},X_=yd({name:"groups",initialState:wL,reducers:{resetIngredientsGroup:e=>{e.ingredientsGroups=[]},addItemToIngredientGroup:(e,t)=>{const{groupName:n,itemName:r,item:o}=t.payload,l=e.ingredientsGroups.find(s=>s.groupName===n);if(l)if(o)l.items.push(o);else{const s={itemName:r,amount:0,unit:vl};l.items.push(s)}else e.ingredientsGroups.push({groupName:n,items:[{itemName:r,amount:0,unit:vl}]})},removeItemFromIngredientGroup:(e,t)=>{const{groupName:n,itemName:r}=t.payload,o=e.ingredientsGroups.find(l=>l.groupName===n);if(o){const l=o.items.findIndex(s=>s.itemName===r);l!==-1&&o.items.splice(l,1),o.items.length===0&&(e.ingredientsGroups=e.ingredientsGroups.filter(s=>s.groupName!==n))}},updateAmount:(e,t)=>{const{groupName:n,itemName:r,amount:o}=t.payload,l=e.ingredientsGroups.find(c=>c.groupName===n),s=l==null?void 0:l.items.filter(c=>c.itemName===r);s&&(s[0].amount=o)},updateUnit:(e,t)=>{const{groupName:n,itemName:r,unit:o}=t.payload,l=e.ingredientsGroups.find(c=>c.groupName===n),s=l==null?void 0:l.items.filter(c=>c.itemName===r);s&&(s[0].unit=o)}}}),{addItemToIngredientGroup:Lm,removeItemFromIngredientGroup:Q_,updateAmount:os,updateUnit:Z_,resetIngredientsGroup:J_}=X_.actions,xL=X_.reducer;function e2(){const e=sg(),t=wn(),n=async()=>{t(q_()),t(Lr("")),t(J_()),t(iL()),e(`/${Mn}`)};return x.jsx("div",{"data-testid":"make_another",onKeyDown:Pi,onClick:n,children:x.jsx("button",{className:"go-to-button-arrow right-0 py-4 bg-green-500 hover:bg-green-400 hover:-translate-y-4",type:"button",children:"MAKE ANOTHER"})})}function bL(){return He(t=>t.groups.ingredientsGroups).map(t=>x.jsxs("div",{className:"flex flex-row items-center justify-between md:gap-x-1 lg:gap-x-2 sm:mb-1 md:mb-2 lg:mb-3 xl:mb-4",children:[x.jsx("p",{className:"group-chip-dead text-fluidPrintSubtitle leading-none px-1 mr-4 sm:max-w-6 md:max-w-8 lg:max-w-10 xl:max-w-12",children:t.groupName}),x.jsx("div",{className:"flex flex-row items-start sm:gap-1 md:gap-2 lg:gap-3",children:t.items.map(n=>x.jsxs("div",{className:"flex flex-col center print-rounded",children:[x.jsx("img",{src:`${Mn}/assets/ingredients/${n.itemName.toLowerCase()}.webp`,alt:n.itemName,className:"card-shadow print-rounded print-image"}),x.jsxs("div",{className:"py-2 h-fit",children:[x.jsx("p",{className:"text-fluidPrintSubtitle leading-tight max-w-6",children:n.itemName}),x.jsx("p",{className:"text-fluidPrintSubtitle leading-tight ",children:x.jsxs("b",{children:[n.amount,"  ",n.unit]})})]})]},`${t.groupName}_${n.itemName}`))})]},t.groupName))}function SL(){return He(t=>t.actions.chefInstructions).map((t,n)=>x.jsxs("div",{className:"flex flex-col md:mb-2 lg:mb-6 xl:mb-10 sm:w-5/6 md:w-5/6 lg:w-4/5 xl:w-full center items-start",children:[x.jsxs("div",{className:"relative flex flex-row md:gap-1 lg:gap-1 xl:gap-4 pointer-events-none items-center justify-start",children:[x.jsxs("span",{className:"instruction-print-text min-w-12",children:["Step ",n+1]}),x.jsx("div",{className:"a4scale-smaller",children:x.jsxs("div",{className:"bg-white card-shadow print-rounded print-image mr-2",children:[x.jsx("img",{draggable:"false",src:`${Mn}/assets/chefActions/${t.action.actionName}.webp`,alt:t.action.actionName,"data-testid":`${t.action.actionName}_action`,className:"print-rounded-img print-image"}),x.jsx("p",{className:"instruction-print-text py-0.5",children:t.action.actionName})]})}),x.jsx("span",{className:"instruction-print-text",children:"THE"}),t.customItem?x.jsx("b",{className:"instruction-print-text",children:t.customItem}):x.jsx("div",{className:"center justify-start sm:w-20 md:w-44 lg:w-52 xl:w-56 flex flex-row flex-wrap",children:t.items.map(r=>x.jsxs("div",{className:"flex center py-1 px-1",children:[x.jsx("img",{src:`${Mn}/assets/ingredients/${r.itemName.toLowerCase()}.webp`,alt:r.itemName,className:"card-shadow print-image print-rounded"})," "]},`${t.id}_${r.itemName}`))}),t.action.time!==-1&&x.jsxs("span",{className:"flex instruction-print-text min-w-12",children:["FOR ",x.jsx("br",{}),t.action.time," ",t.action.unit]})]}),x.jsx("span",{className:"instruction-print-text pt-0.5 lg:pt-1",children:t.note})]},`${t.id}`))}function _L(){const e=He(t=>t.recipe.title);return x.jsxs("div",{"data-testid":"doubleResultpage",className:"relative min-h-screen flex flex-col",children:[x.jsx(e2,{}),x.jsx(ua,{page:"/instructions",isNext:!1}),x.jsxs("div",{className:"flex flex-row center gap-x-8 mt-28 mb-16",children:[x.jsxs("div",{id:"a4_1",className:"relative flex flex-col a4ratio w-1/3 text-center input-border items-center",children:[x.jsx("h1",{className:"recipe-title",children:e}),x.jsx("h2",{className:"recipe-subtitle-text mb-1",children:"page 1"}),x.jsx("hr",{className:"w-1/2 border-gray-200 md:mb-2 lg:mb-4"}),x.jsx("h2",{className:"recipe-subtitle-text sm:mb-2 md:mb-4 lg:mb-8",children:"Ingredients:"}),x.jsx("div",{className:"flex flex-col justify-center",children:x.jsx(bL,{})})]}),x.jsxs("div",{id:"a4_2",className:"relative flex flex-col a4ratio w-1/3 text-center input-border items-center",children:[x.jsx("h1",{className:"recipe-title",children:e}),x.jsx("h2",{className:"recipe-subtitle-text mb-1",children:"page 2"}),x.jsx("hr",{className:"w-1/2 border-gray-200 mb-2"}),x.jsx("h2",{className:"recipe-subtitle-text lg:mb-1 xl:mb-4",children:"Steps:"}),x.jsx("div",{className:"flex flex-col justify-center",children:x.jsx("div",{className:"flex flex-col center",children:x.jsx(SL,{})})}),x.jsx("h2",{className:"recipe-subtitle-text mb-2",children:"Enjoy !"})]})]}),x.jsx("div",{className:"fixed bottom-0 right-0 go-to-button-arrow mb-0",children:x.jsx(K_,{})})]})}function mg(){const e=He(r=>r.warning.warning),t=wn();R.useEffect(()=>{const r=setTimeout(()=>{t(Lr(""))},4e3);return()=>clearTimeout(r)},[t]);const n=()=>{t(Lr(""))};return x.jsx("div",{className:"toast font-indie",onClick:n,onKeyDown:Pi,"data-testid":"snack",children:e})}function EL(){const e=wn(),t=He(p=>p.recipe.possibleItems),n=He(p=>p.recipe.currentGroupName),r=He(p=>p.recipe.currentItem),o=He(p=>p.recipe.title),l=He(p=>p.warning.warning),s=He(p=>p.groups.ingredientsGroups),c=(p,m,v)=>{if(p.preventDefault(),!m)e(Lr("Enter a group name!"));else if(!v)e(Lr("Search an ingredient!"));else if(t.length===0)e(Lr("No items found!"));else if(t.length===1){const S=s.filter(C=>C.groupName===m)[0];if(S)if(S.items.filter(N=>N.itemName===t[0])[0])e(Lr("Ingredient is already in the group!"));else{const N={groupName:m,itemName:t[0]};e(Lm(N))}else{const C={groupName:m,itemName:t[0]};e(Lm(C))}}else e(Lr("Too many ingredients at once!"))},f=p=>{const m=p.currentTarget.value;e(vL(m)),e(gL(m))},h=()=>{e(q_()),e(J_())};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex flex-col w-full h-1/4 center text-center",children:[x.jsx("h1",{className:"mt-4 text-fluidTitle font-shadowsLight",children:"Welcome to a4recipe"}),x.jsx("h3",{className:"pt-2 pb-2 text-fluidSubtitle",children:"Name your recipe and start adding ingredients!"}),x.jsx("input",{type:"text",required:!0,className:`w-inputs center input-border xl:w-96 ${o.length===0&&"required-element-border"}`,placeholder:"Give your recipe a name",value:o,onChange:p=>e(mL(p.target.value)),onKeyDown:p=>{p.key==="Enter"&&p.target.blur()},onFocus:Zc}),x.jsx("div",{className:"md:justify-between lg:justify-center gap-y-4",children:x.jsxs("form",{className:"pt-4 pb-2",children:[x.jsxs("div",{className:"flex flex-row center w-full mb-4 gap-4",children:[x.jsx("input",{type:"text",className:"input-border text-center w-96 lg:mr-8",placeholder:"Search ingredients",value:r,onInput:f,onFocus:Zc}),x.jsx("input",{type:"text",className:"input-border w-60",placeholder:"Give them a group name",value:n,onChange:p=>e(V_(p.target.value)),onFocus:Zc})]}),x.jsxs("div",{className:"flex flex-row justify-between",children:[x.jsx("button",{type:"button",className:"sexy-button bg-slate-500 hover:bg-white hover:text-slate-500 focus:text-slate-500 focus:bg-gray-200 text-gray-50",onClick:h,children:"RESET"}),x.jsx("button",{form:"addIngredientsSelect",type:"submit",className:"sexy-button bg-blue-500 hover:bg-white hover:text-blue-500 focus:text-blue-500 focus:bg-gray-200 text-gray-50",onClick:p=>c(p,n,r),children:"ADD"})]})]})})]}),l&&x.jsx(mg,{})]})}const CL="modulepreload",NL=function(e){return"/a4recipe/"+e},ex={},kL=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.all(n.map(c=>{if(c=NL(c),c in ex)return;ex[c]=!0;const f=c.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":CL,f||(p.as="script",p.crossOrigin=""),p.href=c,s&&p.setAttribute("nonce",s),document.head.appendChild(p),f)return new Promise((m,v)=>{p.addEventListener("load",m),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}return o.then(()=>t()).catch(l=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l})};var RL={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},OL={prefix:"fas",iconName:"angles-right",icon:[512,512,[187,"angle-double-right"],"f101","M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]},t2={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]},n2={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"]},PL={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},wd=PL,TL={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},IL={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},AL={prefix:"fas",iconName:"angles-left",icon:[512,512,[171,"angle-double-left"],"f100","M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"]},J6={prefix:"fas",iconName:"circle-plus",icon:[512,512,["plus-circle"],"f055","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344V280H168c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]};function tx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=w)return i;var P=u-Ea(d);if(P<1)return d;var L=O?Ki(O,0,P).join(""):i.slice(0,P);if(g===n)return L+d;if(O&&(P+=L.length-P),Ap(g)){if(i.slice(P).search(g)){var Y,V=L;for(g.global||(g=qd(g.source,Be(ii.exec(g))+"g")),g.lastIndex=0;Y=g.exec(V);)var q=Y.index;L=L.slice(0,q===n?P:q)}}else if(i.indexOf(Un(g),P)!=P){var re=L.lastIndexOf(g);re>-1&&(L=L.slice(0,re))}return L+d}function FP(i){return i=Be(i),i&&Ut.test(i)?i.replace(dt,pC):i}var zP=Ta(function(i,a,u){return i+(u?" ":"")+a.toUpperCase()}),Mp=s0("toUpperCase");function a1(i,a,u){return i=Be(i),a=u?n:a,a===n?sC(i)?vC(i):JE(i):i.match(a)||[]}var l1=Pe(function(i,a){try{return Fn(i,n,a)}catch(u){return Ip(u)?u:new _e(u)}}),UP=ui(function(i,a){return or(a,function(u){u=Vr(u),li(i,u,Pp(i[u],i))}),i});function $P(i){var a=i==null?0:i.length,u=ve();return i=a?ut(i,function(d){if(typeof d[1]!="function")throw new ar(s);return[u(d[0]),d[1]]}):[],Pe(function(d){for(var g=-1;++gz)return[];var u=ae,d=on(i,ae);a=ve(a),i-=ae;for(var g=Kd(d,a);++u0||a<0)?new Le(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),a!==n&&(a=ke(a),u=a<0?u.dropRight(-a):u.take(a-i)),u)},Le.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Le.prototype.toArray=function(){return this.take(ae)},Kr(Le.prototype,function(i,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),d=/^(?:head|last)$/.test(a),g=y[d?"take"+(a=="last"?"Right":""):a],w=d||/^find/.test(a);g&&(y.prototype[a]=function(){var O=this.__wrapped__,P=d?[1]:arguments,L=O instanceof Le,Y=P[0],V=L||Ce(O),q=function(Te){var je=g.apply(y,Ui([Te],P));return d&&re?je[0]:je};V&&u&&typeof Y=="function"&&Y.length!=1&&(L=V=!1);var re=this.__chain__,fe=!!this.__actions__.length,we=w&&!re,Re=L&&!fe;if(!w&&V){O=Re?O:new Le(this);var xe=i.apply(O,P);return xe.__actions__.push({func:ec,args:[q],thisArg:n}),new lr(xe,re)}return we&&Re?i.apply(this,P):(xe=this.thru(q),we?d?xe.value()[0]:xe.value():xe)})}),or(["pop","push","shift","sort","splice","unshift"],function(i){var a=Nu[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);y.prototype[i]=function(){var g=arguments;if(d&&!this.__chain__){var w=this.value();return a.apply(Ce(w)?w:[],g)}return this[u](function(O){return a.apply(Ce(O)?O:[],g)})}}),Kr(Le.prototype,function(i,a){var u=y[a];if(u){var d=u.name+"";Ke.call(Ra,d)||(Ra[d]=[]),Ra[d].push({name:a,func:u})}}),Ra[Yu(n,_).name]=[{name:"wrapper",func:n}],Le.prototype.clone=FC,Le.prototype.reverse=zC,Le.prototype.value=UC,y.prototype.at=mR,y.prototype.chain=vR,y.prototype.commit=gR,y.prototype.next=yR,y.prototype.plant=xR,y.prototype.reverse=bR,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=SR,y.prototype.first=y.prototype.head,Al&&(y.prototype[Al]=wR),y},Ca=gC();Io?((Io.exports=Ca)._=Ca,Fd._=Ca):Vt._=Ca}).call(Yl)})(Df,Df.exports);var Go=Df.exports;const rL={chefInstructions:[],currentInstruction:null,availableItems:[]},H_=yd({name:"chefActions",initialState:rL,reducers:{resetChefInstructions:e=>{e.chefInstructions=[]},setCustomInstructionItem:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);n&&(n.customItem=t.payload.customItem)},addChefInstruction:(e,t)=>{e.chefInstructions.push(t.payload)},removeChefInstruction:(e,t)=>{e.chefInstructions.find(r=>Go.isEqual(r,t.payload))&&(e.chefInstructions=e.chefInstructions.filter(r=>!Go.isEqual(r,t.payload)))},updateChefInstructionItems:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);if(n){const r={...n,items:t.payload.items};e.chefInstructions=e.chefInstructions.filter(o=>!Go.isEqual(o,n)),e.chefInstructions.push(r)}},updateInstructionTime:(e,t)=>{const{instruction:n,time:r}=t.payload,o=e.chefInstructions.find(l=>Go.isEqual(l,n));o&&(o.action.time=r)},updateInstructionAction:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);n&&(n.action=t.payload.action)},updateInstructionNote:(e,t)=>{const n=e.chefInstructions.find(r=>r.id===t.payload.id);n&&(n.note=t.payload.note)},setAvailableItems:(e,t)=>{e.availableItems=t.payload},updateAvailableItem:(e,t)=>{const n=e.availableItems.findIndex(r=>Go.isEqual(r,t.payload));n===-1?e.availableItems.push(t.payload):e.availableItems.splice(n,1)},updateAvailableItems:(e,t)=>{e.availableItems.push(...t.payload)}}}),{resetChefInstructions:iL,setCustomInstructionItem:oL,addChefInstruction:aL,removeChefInstruction:lL,updateChefInstructionItems:G_,updateInstructionTime:sL,updateInstructionAction:uL,updateInstructionNote:kc,setAvailableItems:cL,updateAvailableItem:hg,updateAvailableItems:fL}=H_.actions,dL=H_.reducer;function ua({page:e,isNext:t}){const n=sg(),r=wn(),o=He(p=>p.recipe.title),l=He(p=>p.groups.ingredientsGroups),s=He(p=>p.actions.chefInstructions),c=async()=>{const p=l.flatMap(S=>S.items.flat()),m=p.every(S=>S.amount>0),v=p.every(S=>S.unit!==vl);return m&&v},f=async()=>{const p=s.every(v=>v.items.length>0||v.customItem),m=s.every(v=>v.action.time!==0);return s.length>0&&p&&m},h=async()=>{if(t){let p=!1,m="";if(e==="/quantities"&&(o.length>0&&l.length>0?p=!0:m="You must have a Recipe Title and ingredients!"),e==="/instructions")if(await c()){p=!0;const v=l.flatMap(S=>S.items.flat());r(cL(v))}else m="Fill in all quantities and units!";(e==="/print"||e==="/doublePrint")&&(await f()?p=!0:m="Create some instructions with ingredients!"),p?(r(Lr("")),n(e)):r(Lr(m))}else r(Lr("")),n(e,{replace:!0})};return x.jsx("div",{"data-testid":t?"next":"back",onKeyDown:Pi,onClick:h,children:t?x.jsx("button",{className:"go-to-button-arrow right-0 bg-green-500 hover:bg-green-400 hover:translate-x-4",type:"button",children:"NEXT"}):x.jsx("button",{className:"go-to-button-arrow left-0 bg-red-500 hover:bg-red-400 hover:-translate-x-4",type:"button",children:"BACK"})})}function K_(){return x.jsx("div",{"data-testid":"print",onKeyDown:Pi,onClick:()=>console.log("here"),children:x.jsxs("button",{type:"button",className:"print-to-a4-button",children:["PRINT",x.jsx("br",{}),"TO A4"]})})}const no=["All-purpose flour","Almond flour","Almond milk","Apples","Artichoke","Asparagus","Avocado","Bacon","Baguette","Baking powder","Baking soda","Banana","Barley","Basil","Bay leaves","Beans","Bean sprouts","Beets","Black beans","Black-eyed peas","Black olives","Black pepper","Blueberries","Bread","Bread buns","Bread crumbs","Bread flour","Broccoli","Brown butter","Brown lentils","Brown rice","Brown sugar","Brussels sprouts","Butter","Buttermilk","Cabbage","Cake flour","Candied ginger","Carrots","Cashew nuts","Cauliflower","Celery","Cheddar cheese","Cherries","Chia seeds","Chicken breasts","Chicken broth","Chickpeas","Chili powder","Cilantro","Cinnamon","Cloves","Cocoa nibs","Cocoa powder","Coconut milk","Coconut oil","Condensed milk","Cornmeal","Cornstarch","Corn syrup","Couscous","Cranberries","Cream cheese","Cumin","Dark chocolate","Dill","Eggs","Eggwhite","Fennel","Feta cheese","Fish sauce","Garlic","Gelatin","Ginger","Goat cheese","Grapes","Graham crackers","Greek yogurt","Green beans","Green lentils","Green olives","Ground beef","Ham","Hazelnuts","Heavy cream","Honey","Hot sauce","Kale","Ketchup","Leek","Lemon","Lemon juice","Lemon zest","Lentils","Lima beans","Lime","Macadamia nuts","Maple syrup","Marzipan","Mayonnaise","Milk","Molasses","Mozzarella cheese","Mung beans","Mushrooms","Mustard","Nutmeg","Oats","Olive oil","Onion","Orange","Oregano","Paprika","Parmesan cheese","Parsley","Pasta","Peas","Pecan flour","Pecans","Pecorino cheese","Pineapple","Pine nuts","Poppy seeds","Pork chop","Potatoes","Powdered sugar","Quinoa","Raisins","Raspberries","Red Bell Pepper","Red pepper flakes","Rice","Ricotta cheese","Rosemary","Salmon","Salt","Sausage","Seasoning","Shortening","Sliced bread","Sour cream","Soy sauce","Spinach","Sugar","Swiss cheese","Thyme","Tomato paste","Tomato sauce","Turkey","Vanilla bean","Vanilla extract","Vanilla sugar","Vegetable oil","Vinegar","Water","Walnuts","White chocolate","Whole wheat flour","Yeast","Yellow Bell Pepper","Yogurt","Yolk","Zucchini"],Rc=["mg","g","kg","ml","liter","whole","quart","pint","lbs","oz","tsp","tbsp","cup","can"],Jw=[vl,"gallon","piece","slice","strip","drop","dash","smidgen","bunch","jar","stick","clove","head","fillet","block","sheet","pack","packet","bag","bar","cube","handful","bottle","sprig","stalk","ear","bowl","scoop","dozen","pinch"],pL=[{actionName:"Add",time:-1,unit:"min",equipment:"hand"},{actionName:"Bake",time:20,unit:"min",equipment:"oven"},{actionName:"Blanch",time:1,unit:"min",equipment:"stove"},{actionName:"Blend",time:-1,unit:"min",equipment:"blender"},{actionName:"Boil",time:5,unit:"min",equipment:"stove"},{actionName:"Braise",time:10,unit:"min",equipment:"oven"},{actionName:"Broil",time:20,unit:"min",equipment:"broiler"},{actionName:"Chill",time:5,unit:"min",equipment:"hand"},{actionName:"Chop",time:-1,unit:"min",equipment:"knife"},{actionName:"Core",time:-1,unit:"min",equipment:"corer"},{actionName:"Cure",time:5,unit:"hours",equipment:"refrigerator"},{actionName:"Dice",time:-1,unit:"min",equipment:"knife"},{actionName:"Dress",time:-1,unit:"min",equipment:"none"},{actionName:"Emulsify",time:-1,unit:"min",equipment:"blender"},{actionName:"Fold",time:-1,unit:"min",equipment:"spatula"},{actionName:"Ferment",time:24,unit:"hours",equipment:"refrigerator"},{actionName:"Fry",time:5,unit:"min",equipment:"stove"},{actionName:"Garnish",time:-1,unit:"min",equipment:"none"},{actionName:"Glaze",time:-1,unit:"min",equipment:"brush"},{actionName:"Grate",time:-1,unit:"min",equipment:"grater"},{actionName:"Grill",time:20,unit:"min",equipment:"grill"},{actionName:"Infuse",time:-1,unit:"min",equipment:"stove"},{actionName:"Knead",time:10,unit:"min",equipment:"stand mixer"},{actionName:"Marinate",time:8,unit:"hours",equipment:"refrigerator"},{actionName:"Mince",time:-1,unit:"min",equipment:"knife"},{actionName:"Mix",time:-1,unit:"min",equipment:"bowl"},{actionName:"Peel",time:-1,unit:"min",equipment:"peeler"},{actionName:"Poach",time:8,unit:"min",equipment:"stove"},{actionName:"Purée",time:-1,unit:"min",equipment:"food processor"},{actionName:"Roast",time:20,unit:"min",equipment:"oven"},{actionName:"Sauté",time:5,unit:"min",equipment:"stove"},{actionName:"Score",time:-1,unit:"min",equipment:"knife"},{actionName:"Sear",time:2,unit:"min",equipment:"stove"},{actionName:"Season",time:-1,unit:"min",equipment:"none"},{actionName:"Shred",time:-1,unit:"min",equipment:"grater"},{actionName:"Sieve",time:-1,unit:"min",equipment:"sieve"},{actionName:"Simmer",time:30,unit:"min",equipment:"stove"},{actionName:"Slice",time:-1,unit:"min",equipment:"knife"},{actionName:"Smoke",time:2,unit:"hours",equipment:"smoker"},{actionName:"Steam",time:10,unit:"min",equipment:"steamer"},{actionName:"Stew",time:45,unit:"min",equipment:"slow cooker"},{actionName:"Strain",time:-1,unit:"min",equipment:"strainer"},{actionName:"Toast",time:2,unit:"min",equipment:"toaster"},{actionName:"Trim",time:-1,unit:"min",equipment:"knife"},{actionName:"Warm",time:5,unit:"min",equipment:"hand"},{actionName:"Whisk",time:5,unit:"min",equipment:"hand mixer"}],hL={title:"",currentItem:"",currentGroupName:"",possibleItems:no,batches:1,invalidState:!1},Y_=yd({name:"recipe",initialState:hL,reducers:{resetRecipe:e=>{e.title="",e.currentItem="",e.currentGroupName="",e.possibleItems=no,e.batches=1,e.invalidState=!1},toggleInvalidState:e=>{e.invalidState=!e.invalidState},nameRecipe:(e,t)=>{e.title=t.payload},nameGroup:(e,t)=>{e.currentGroupName=t.payload},setItem:(e,t)=>{e.currentItem=t.payload},updatePossibleItems:(e,t)=>{e.possibleItems=no.filter(n=>n.toLowerCase().includes(t.payload.toLowerCase()))},setBatches:(e,t)=>{e.batches=t.payload}}}),{nameRecipe:mL,nameGroup:V_,setItem:vL,updatePossibleItems:gL,setBatches:Q6,resetRecipe:q_,toggleInvalidState:Z6}=Y_.actions,yL=Y_.reducer,wL={ingredientsGroups:[]},X_=yd({name:"groups",initialState:wL,reducers:{resetIngredientsGroup:e=>{e.ingredientsGroups=[]},addItemToIngredientGroup:(e,t)=>{const{groupName:n,itemName:r,item:o}=t.payload,l=e.ingredientsGroups.find(s=>s.groupName===n);if(l)if(o)l.items.push(o);else{const s={itemName:r,amount:0,unit:vl};l.items.push(s)}else e.ingredientsGroups.push({groupName:n,items:[{itemName:r,amount:0,unit:vl}]})},removeItemFromIngredientGroup:(e,t)=>{const{groupName:n,itemName:r}=t.payload,o=e.ingredientsGroups.find(l=>l.groupName===n);if(o){const l=o.items.findIndex(s=>s.itemName===r);l!==-1&&o.items.splice(l,1),o.items.length===0&&(e.ingredientsGroups=e.ingredientsGroups.filter(s=>s.groupName!==n))}},updateAmount:(e,t)=>{const{groupName:n,itemName:r,amount:o}=t.payload,l=e.ingredientsGroups.find(c=>c.groupName===n),s=l==null?void 0:l.items.filter(c=>c.itemName===r);s&&(s[0].amount=o)},updateUnit:(e,t)=>{const{groupName:n,itemName:r,unit:o}=t.payload,l=e.ingredientsGroups.find(c=>c.groupName===n),s=l==null?void 0:l.items.filter(c=>c.itemName===r);s&&(s[0].unit=o)}}}),{addItemToIngredientGroup:Lm,removeItemFromIngredientGroup:Q_,updateAmount:os,updateUnit:Z_,resetIngredientsGroup:J_}=X_.actions,xL=X_.reducer;function e2(){const e=sg(),t=wn(),n=async()=>{t(q_()),t(Lr("")),t(J_()),t(iL()),e(`${Mn}/`)};return x.jsx("div",{"data-testid":"make_another",onKeyDown:Pi,onClick:n,children:x.jsx("button",{className:"go-to-button-arrow right-0 py-4 bg-green-500 hover:bg-green-400 hover:-translate-y-4",type:"button",children:"MAKE ANOTHER"})})}function bL(){return He(t=>t.groups.ingredientsGroups).map(t=>x.jsxs("div",{className:"flex flex-row items-center justify-between md:gap-x-1 lg:gap-x-2 sm:mb-1 md:mb-2 lg:mb-3 xl:mb-4",children:[x.jsx("p",{className:"group-chip-dead text-fluidPrintSubtitle leading-none px-1 mr-4 sm:max-w-6 md:max-w-8 lg:max-w-10 xl:max-w-12",children:t.groupName}),x.jsx("div",{className:"flex flex-row items-start sm:gap-1 md:gap-2 lg:gap-3",children:t.items.map(n=>x.jsxs("div",{className:"flex flex-col center print-rounded",children:[x.jsx("img",{src:`${Mn}/assets/ingredients/${n.itemName.toLowerCase()}.webp`,alt:n.itemName,className:"card-shadow print-rounded print-image"}),x.jsxs("div",{className:"py-2 h-fit",children:[x.jsx("p",{className:"text-fluidPrintSubtitle leading-tight max-w-6",children:n.itemName}),x.jsx("p",{className:"text-fluidPrintSubtitle leading-tight ",children:x.jsxs("b",{children:[n.amount,"  ",n.unit]})})]})]},`${t.groupName}_${n.itemName}`))})]},t.groupName))}function SL(){return He(t=>t.actions.chefInstructions).map((t,n)=>x.jsxs("div",{className:"flex flex-col md:mb-2 lg:mb-6 xl:mb-10 sm:w-5/6 md:w-5/6 lg:w-4/5 xl:w-full center items-start",children:[x.jsxs("div",{className:"relative flex flex-row md:gap-1 lg:gap-1 xl:gap-4 pointer-events-none items-center justify-start",children:[x.jsxs("span",{className:"instruction-print-text min-w-12",children:["Step ",n+1]}),x.jsx("div",{className:"a4scale-smaller",children:x.jsxs("div",{className:"bg-white card-shadow print-rounded print-image mr-2",children:[x.jsx("img",{draggable:"false",src:`${Mn}/assets/chefActions/${t.action.actionName}.webp`,alt:t.action.actionName,"data-testid":`${t.action.actionName}_action`,className:"print-rounded-img print-image"}),x.jsx("p",{className:"instruction-print-text py-0.5",children:t.action.actionName})]})}),x.jsx("span",{className:"instruction-print-text",children:"THE"}),t.customItem?x.jsx("b",{className:"instruction-print-text",children:t.customItem}):x.jsx("div",{className:"center justify-start sm:w-20 md:w-44 lg:w-52 xl:w-56 flex flex-row flex-wrap",children:t.items.map(r=>x.jsxs("div",{className:"flex center py-1 px-1",children:[x.jsx("img",{src:`${Mn}/assets/ingredients/${r.itemName.toLowerCase()}.webp`,alt:r.itemName,className:"card-shadow print-image print-rounded"})," "]},`${t.id}_${r.itemName}`))}),t.action.time!==-1&&x.jsxs("span",{className:"flex instruction-print-text min-w-12",children:["FOR ",x.jsx("br",{}),t.action.time," ",t.action.unit]})]}),x.jsx("span",{className:"instruction-print-text pt-0.5 lg:pt-1",children:t.note})]},`${t.id}`))}function _L(){const e=He(t=>t.recipe.title);return x.jsxs("div",{"data-testid":"doubleResultpage",className:"relative min-h-screen flex flex-col",children:[x.jsx(e2,{}),x.jsx(ua,{page:"/instructions",isNext:!1}),x.jsxs("div",{className:"flex flex-row center gap-x-8 mt-28 mb-16",children:[x.jsxs("div",{id:"a4_1",className:"relative flex flex-col a4ratio w-1/3 text-center input-border items-center",children:[x.jsx("h1",{className:"recipe-title",children:e}),x.jsx("h2",{className:"recipe-subtitle-text mb-1",children:"page 1"}),x.jsx("hr",{className:"w-1/2 border-gray-200 md:mb-2 lg:mb-4"}),x.jsx("h2",{className:"recipe-subtitle-text sm:mb-2 md:mb-4 lg:mb-8",children:"Ingredients:"}),x.jsx("div",{className:"flex flex-col justify-center",children:x.jsx(bL,{})})]}),x.jsxs("div",{id:"a4_2",className:"relative flex flex-col a4ratio w-1/3 text-center input-border items-center",children:[x.jsx("h1",{className:"recipe-title",children:e}),x.jsx("h2",{className:"recipe-subtitle-text mb-1",children:"page 2"}),x.jsx("hr",{className:"w-1/2 border-gray-200 mb-2"}),x.jsx("h2",{className:"recipe-subtitle-text lg:mb-1 xl:mb-4",children:"Steps:"}),x.jsx("div",{className:"flex flex-col justify-center",children:x.jsx("div",{className:"flex flex-col center",children:x.jsx(SL,{})})}),x.jsx("h2",{className:"recipe-subtitle-text mb-2",children:"Enjoy !"})]})]}),x.jsx("div",{className:"fixed bottom-0 right-0 go-to-button-arrow mb-0",children:x.jsx(K_,{})})]})}function mg(){const e=He(r=>r.warning.warning),t=wn();R.useEffect(()=>{const r=setTimeout(()=>{t(Lr(""))},4e3);return()=>clearTimeout(r)},[t]);const n=()=>{t(Lr(""))};return x.jsx("div",{className:"toast font-indie",onClick:n,onKeyDown:Pi,"data-testid":"snack",children:e})}function EL(){const e=wn(),t=He(p=>p.recipe.possibleItems),n=He(p=>p.recipe.currentGroupName),r=He(p=>p.recipe.currentItem),o=He(p=>p.recipe.title),l=He(p=>p.warning.warning),s=He(p=>p.groups.ingredientsGroups),c=(p,m,v)=>{if(p.preventDefault(),!m)e(Lr("Enter a group name!"));else if(!v)e(Lr("Search an ingredient!"));else if(t.length===0)e(Lr("No items found!"));else if(t.length===1){const S=s.filter(C=>C.groupName===m)[0];if(S)if(S.items.filter(N=>N.itemName===t[0])[0])e(Lr("Ingredient is already in the group!"));else{const N={groupName:m,itemName:t[0]};e(Lm(N))}else{const C={groupName:m,itemName:t[0]};e(Lm(C))}}else e(Lr("Too many ingredients at once!"))},f=p=>{const m=p.currentTarget.value;e(vL(m)),e(gL(m))},h=()=>{e(q_()),e(J_())};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex flex-col w-full h-1/4 center text-center",children:[x.jsx("h1",{className:"mt-4 text-fluidTitle font-shadowsLight",children:"Welcome to a4recipe"}),x.jsx("h3",{className:"pt-2 pb-2 text-fluidSubtitle",children:"Name your recipe and start adding ingredients!"}),x.jsx("input",{type:"text",required:!0,className:`w-inputs center input-border xl:w-96 ${o.length===0&&"required-element-border"}`,placeholder:"Give your recipe a name",value:o,onChange:p=>e(mL(p.target.value)),onKeyDown:p=>{p.key==="Enter"&&p.target.blur()},onFocus:Zc}),x.jsx("div",{className:"md:justify-between lg:justify-center gap-y-4",children:x.jsxs("form",{className:"pt-4 pb-2",children:[x.jsxs("div",{className:"flex flex-row center w-full mb-4 gap-4",children:[x.jsx("input",{type:"text",className:"input-border text-center w-96 lg:mr-8",placeholder:"Search ingredients",value:r,onInput:f,onFocus:Zc}),x.jsx("input",{type:"text",className:"input-border w-60",placeholder:"Give them a group name",value:n,onChange:p=>e(V_(p.target.value)),onFocus:Zc})]}),x.jsxs("div",{className:"flex flex-row justify-between",children:[x.jsx("button",{type:"button",className:"sexy-button bg-slate-500 hover:bg-white hover:text-slate-500 focus:text-slate-500 focus:bg-gray-200 text-gray-50",onClick:h,children:"RESET"}),x.jsx("button",{form:"addIngredientsSelect",type:"submit",className:"sexy-button bg-blue-500 hover:bg-white hover:text-blue-500 focus:text-blue-500 focus:bg-gray-200 text-gray-50",onClick:p=>c(p,n,r),children:"ADD"})]})]})})]}),l&&x.jsx(mg,{})]})}const CL="modulepreload",NL=function(e){return"/a4recipe/"+e},ex={},kL=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.all(n.map(c=>{if(c=NL(c),c in ex)return;ex[c]=!0;const f=c.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":CL,f||(p.as="script",p.crossOrigin=""),p.href=c,s&&p.setAttribute("nonce",s),document.head.appendChild(p),f)return new Promise((m,v)=>{p.addEventListener("load",m),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}return o.then(()=>t()).catch(l=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l})};var RL={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},OL={prefix:"fas",iconName:"angles-right",icon:[512,512,[187,"angle-double-right"],"f101","M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]},t2={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]},n2={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"]},PL={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},wd=PL,TL={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},IL={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},AL={prefix:"fas",iconName:"angles-left",icon:[512,512,[171,"angle-double-left"],"f100","M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"]},J6={prefix:"fas",iconName:"circle-plus",icon:[512,512,["plus-circle"],"f055","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344V280H168c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]};function tx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1;o--){var l=n[o],s=(l.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=l)}return lt.head.insertBefore(t,r),e}}var oM="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function eu(){for(var e=12,t="";e-- >0;)t+=oM[Math.random()*62|0];return t}function Cl(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function bg(e){return e.classList?Cl(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function h2(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function aM(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(h2(e[n]),'" ')},"").trim()}function xd(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function Sg(e){return e.size!==ei.size||e.x!==ei.x||e.y!==ei.y||e.rotate!==ei.rotate||e.flipX||e.flipY}function lM(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,o={transform:"translate(".concat(n/2," 256)")},l="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),c="rotate(".concat(t.rotate," 0 0)"),f={transform:"".concat(l," ").concat(s," ").concat(c)},h={transform:"translate(".concat(r/2*-1," -256)")};return{outer:o,inner:f,path:h}}function sM(e){var t=e.transform,n=e.width,r=n===void 0?jm:n,o=e.height,l=o===void 0?jm:o,s=e.startCentered,c=s===void 0?!1:s,f="";return c&&l2?f+="translate(".concat(t.x/qi-r/2,"em, ").concat(t.y/qi-l/2,"em) "):c?f+="translate(calc(-50% + ".concat(t.x/qi,"em), calc(-50% + ").concat(t.y/qi,"em)) "):f+="translate(".concat(t.x/qi,"em, ").concat(t.y/qi,"em) "),f+="scale(".concat(t.size/qi*(t.flipX?-1:1),", ").concat(t.size/qi*(t.flipY?-1:1),") "),f+="rotate(".concat(t.rotate,"deg) "),f}var uM=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid"; @@ -883,7 +883,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `+o:"")+` The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=U2,t.componentWillReceiveProps=$2),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=B2;var c=t.componentDidUpdate;t.componentDidUpdate=function(h,p,m){var v=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:m;c.call(this,h,p,v)}}return e}const bj=Object.freeze(Object.defineProperty({__proto__:null,polyfill:xj},Symbol.toStringTag,{value:"Module"})),Sj=CT(bj);Object.defineProperty(da,"__esModule",{value:!0});da.bodyOpenClassName=da.portalClassName=void 0;var Px=Object.assign||function(e){for(var t=1;t{r(c=>(c+1)%no.length)},[]),l=R.useCallback(()=>{r(c=>c===0?no.length-1:c-1)},[]),s=R.useCallback(c=>{c.key==="ArrowRight"?o():c.key==="ArrowLeft"&&l()},[o,l]);return R.useEffect(()=>(e?document.addEventListener("keydown",s):document.removeEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}),[e,s]),Mx.setAppElement(document.getElementById("root")),x.jsx(Mx,{isOpen:e,onRequestClose:()=>t(),className:"modal-container",overlayClassName:"modal-overlay",shouldCloseOnOverlayClick:!0,children:x.jsxs("div",{className:"modal-content",children:[x.jsx("button",{type:"button",className:"close-modal-button",onClick:()=>t(),children:x.jsx(Ln,{icon:wd,className:"nav-icon"})}),x.jsx("span",{className:"modal-image-title",children:no[n]}),x.jsx("img",{src:`${Mn}/assets/ingredients/${no[n].toLowerCase()}.webp`,alt:`${no[n]}`,className:"modal-image"}),x.jsxs("div",{className:"modal-nav-buttons",children:[x.jsx("button",{type:"button",className:"nav-button prev",onClick:l,children:x.jsx(Ln,{icon:TL,className:"nav-icon"})}),x.jsx("button",{type:"button",className:"nav-button next",onClick:o,children:x.jsx(Ln,{icon:IL,className:"nav-icon"})})]})]})})}const jj=R.lazy(()=>kL(()=>import("./IngredientGalleryItem-ZncCOUle.js"),[]));function Fj(){const[e,t]=R.useState(!1),n=He(o=>o.recipe.possibleItems),r=n.length<5?"flex flex-row gap-x-8":"grid-autofill";return x.jsxs(x.Fragment,{children:[!e&&x.jsxs("div",{className:"modal-open-button",onClick:()=>t(!0),onKeyDown:Pi,children:["CLICK ME",x.jsx("br",{}),'to say "Wow"',x.jsx("br",{}),'and "Ooooh"']}),x.jsx(Mj,{isOpen:e,onClose:()=>t(!1)}),x.jsx("div",{className:"flex flex-row overflow-auto no-scrollbar justify-evenly",children:x.jsx("div",{className:`flex flex-row flex-wrap center gap-y-8 gap-x-4 ${r}`,children:n.map(o=>x.jsx(R.Suspense,{fallback:x.jsx("div",{className:"suspense-gallery-item","data-testid":`${o}_suspense`,children:""}),children:x.jsx(jj,{item:{itemName:o,amount:0,unit:vl}})},`${o}_suspense`))})})]})}function zj(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(o=>o(r))},t)}const Cd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ig(e){return"nodeType"in e}function bn(e){var t,n;return e?Rl(e)?e:Ig(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ag(e){const{Document:t}=bn(e);return e instanceof t}function gu(e){return Rl(e)?!1:e instanceof bn(e).HTMLElement}function H2(e){return e instanceof bn(e).SVGElement}function Ol(e){return e?Rl(e)?e.document:Ig(e)?Ag(e)?e:gu(e)||H2(e)?e.ownerDocument:document:document:document}const $r=Cd?R.useLayoutEffect:R.useEffect;function Nd(e){const t=R.useRef(e);return $r(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o{e.current=setInterval(r,o)},[]),n=R.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ru(e,t){t===void 0&&(t=[e]);const n=R.useRef(e);return $r(()=>{n.current!==e&&(n.current=e)},t),n}function yu(e,t){const n=R.useRef();return R.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bf(e){const t=Nd(e),n=R.useRef(null),r=R.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Wf(e){const t=R.useRef();return R.useEffect(()=>{t.current=e},[e]),t.current}let Nh={};function kd(e,t){return R.useMemo(()=>{if(t)return t;const n=Nh[e]==null?0:Nh[e]+1;return Nh[e]=n,e+"-"+n},[e,t])}function G2(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const c=Object.entries(s);for(const[f,h]of c){const p=l[f];p!=null&&(l[f]=p+e*h)}return l},{...t})}}const ll=G2(1),Hf=G2(-1);function $j(e){return"clientX"in e&&"clientY"in e}function Rd(e){if(!e)return!1;const{KeyboardEvent:t}=bn(e.target);return t&&e instanceof t}function Bj(e){if(!e)return!1;const{TouchEvent:t}=bn(e.target);return t&&e instanceof t}function Gf(e){if(Bj(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return $j(e)?{x:e.clientX,y:e.clientY}:null}const Ri=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ri.Translate.toString(e),Ri.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),jx="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Wj(e){return e.matches(jx)?e:e.querySelector(jx)}const Hj={display:"none"};function Gj(e){let{id:t,value:n}=e;return Qe.createElement("div",{id:t,style:Hj},n)}function Kj(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Qe.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Yj(){const[e,t]=R.useState("");return{announce:R.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const K2=R.createContext(null);function Vj(e){const t=R.useContext(K2);R.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function qj(){const[e]=R.useState(()=>new Set),t=R.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[R.useCallback(r=>{let{type:o,event:l}=r;e.forEach(s=>{var c;return(c=s[o])==null?void 0:c.call(s,l)})},[e]),t]}const Xj={draggable:` +https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=U2,t.componentWillReceiveProps=$2),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=B2;var c=t.componentDidUpdate;t.componentDidUpdate=function(h,p,m){var v=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:m;c.call(this,h,p,v)}}return e}const bj=Object.freeze(Object.defineProperty({__proto__:null,polyfill:xj},Symbol.toStringTag,{value:"Module"})),Sj=CT(bj);Object.defineProperty(da,"__esModule",{value:!0});da.bodyOpenClassName=da.portalClassName=void 0;var Px=Object.assign||function(e){for(var t=1;t{r(c=>(c+1)%no.length)},[]),l=R.useCallback(()=>{r(c=>c===0?no.length-1:c-1)},[]),s=R.useCallback(c=>{c.key==="ArrowRight"?o():c.key==="ArrowLeft"&&l()},[o,l]);return R.useEffect(()=>(e?document.addEventListener("keydown",s):document.removeEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}),[e,s]),Mx.setAppElement(document.getElementById("root")),x.jsx(Mx,{isOpen:e,onRequestClose:()=>t(),className:"modal-container",overlayClassName:"modal-overlay",shouldCloseOnOverlayClick:!0,children:x.jsxs("div",{className:"modal-content",children:[x.jsx("button",{type:"button",className:"close-modal-button",onClick:()=>t(),children:x.jsx(Ln,{icon:wd,className:"nav-icon"})}),x.jsx("span",{className:"modal-image-title",children:no[n]}),x.jsx("img",{src:`${Mn}/assets/ingredients/${no[n].toLowerCase()}.webp`,alt:`${no[n]}`,className:"modal-image"}),x.jsxs("div",{className:"modal-nav-buttons",children:[x.jsx("button",{type:"button",className:"nav-button prev",onClick:l,children:x.jsx(Ln,{icon:TL,className:"nav-icon"})}),x.jsx("button",{type:"button",className:"nav-button next",onClick:o,children:x.jsx(Ln,{icon:IL,className:"nav-icon"})})]})]})})}const jj=R.lazy(()=>kL(()=>import("./IngredientGalleryItem-D5n1mWkc.js"),[]));function Fj(){const[e,t]=R.useState(!1),n=He(o=>o.recipe.possibleItems),r=n.length<5?"flex flex-row gap-x-8":"grid-autofill";return x.jsxs(x.Fragment,{children:[!e&&x.jsxs("div",{className:"modal-open-button",onClick:()=>t(!0),onKeyDown:Pi,children:["CLICK ME",x.jsx("br",{}),'to say "Wow"',x.jsx("br",{}),'and "Ooooh"']}),x.jsx(Mj,{isOpen:e,onClose:()=>t(!1)}),x.jsx("div",{className:"flex flex-row overflow-auto no-scrollbar justify-evenly",children:x.jsx("div",{className:`flex flex-row flex-wrap center gap-y-8 gap-x-4 ${r}`,children:n.map(o=>x.jsx(R.Suspense,{fallback:x.jsx("div",{className:"suspense-gallery-item","data-testid":`${o}_suspense`,children:""}),children:x.jsx(jj,{item:{itemName:o,amount:0,unit:vl}})},`${o}_suspense`))})})]})}function zj(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(o=>o(r))},t)}const Cd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ig(e){return"nodeType"in e}function bn(e){var t,n;return e?Rl(e)?e:Ig(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ag(e){const{Document:t}=bn(e);return e instanceof t}function gu(e){return Rl(e)?!1:e instanceof bn(e).HTMLElement}function H2(e){return e instanceof bn(e).SVGElement}function Ol(e){return e?Rl(e)?e.document:Ig(e)?Ag(e)?e:gu(e)||H2(e)?e.ownerDocument:document:document:document}const $r=Cd?R.useLayoutEffect:R.useEffect;function Nd(e){const t=R.useRef(e);return $r(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o{e.current=setInterval(r,o)},[]),n=R.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ru(e,t){t===void 0&&(t=[e]);const n=R.useRef(e);return $r(()=>{n.current!==e&&(n.current=e)},t),n}function yu(e,t){const n=R.useRef();return R.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bf(e){const t=Nd(e),n=R.useRef(null),r=R.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Wf(e){const t=R.useRef();return R.useEffect(()=>{t.current=e},[e]),t.current}let Nh={};function kd(e,t){return R.useMemo(()=>{if(t)return t;const n=Nh[e]==null?0:Nh[e]+1;return Nh[e]=n,e+"-"+n},[e,t])}function G2(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const c=Object.entries(s);for(const[f,h]of c){const p=l[f];p!=null&&(l[f]=p+e*h)}return l},{...t})}}const ll=G2(1),Hf=G2(-1);function $j(e){return"clientX"in e&&"clientY"in e}function Rd(e){if(!e)return!1;const{KeyboardEvent:t}=bn(e.target);return t&&e instanceof t}function Bj(e){if(!e)return!1;const{TouchEvent:t}=bn(e.target);return t&&e instanceof t}function Gf(e){if(Bj(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return $j(e)?{x:e.clientX,y:e.clientY}:null}const Ri=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ri.Translate.toString(e),Ri.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),jx="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Wj(e){return e.matches(jx)?e:e.querySelector(jx)}const Hj={display:"none"};function Gj(e){let{id:t,value:n}=e;return Qe.createElement("div",{id:t,style:Hj},n)}function Kj(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Qe.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Yj(){const[e,t]=R.useState("");return{announce:R.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const K2=R.createContext(null);function Vj(e){const t=R.useContext(K2);R.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function qj(){const[e]=R.useState(()=>new Set),t=R.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[R.useCallback(r=>{let{type:o,event:l}=r;e.forEach(s=>{var c;return(c=s[o])==null?void 0:c.call(s,l)})},[e]),t]}const Xj={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. diff --git a/index.html b/index.html index c046cec..fc5f14e 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ a4recipe - +