PageSourceSearch

https://www.foodlabelsolutions.com/static/js/9949.1ca13434.chunk.js

js foodlabelsolutions.com collected 2026-10-06 22:32:29 UTC 28,753 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfolsol_website=self.webpackChunkfolsol_website||[]).push([[9949],{83182:(he,k,i)=>{i.d(k,{A:()=>fe});var e=i(58168),f=i(80045),V=i(96540),$=i(20053),te=i(32150),O=i(67515),C=44,se=function(g){return{root:{display:"inline-block"},static:{transition:g.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:g.transitions.create("transform")},colorPrimary:{color:g.palette.primary.main},colorSecondary:{color:g.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:g.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:g.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}},Fe=V.forwardRef(function(g,Re){var T=g.classes,ze=g.className,P=g.color,N=P===void 0?"primary":P,H=g.disableShrink,Ke=H===void 0?!1:H,ye=g.size,ne=ye===void 0?40:ye,De=g.style,Ae=g.thickness,me=Ae===void 0?3.6:Ae,Oe=g.value,Me=Oe===void 0?0:Oe,Le=g.variant,ce=Le===void 0?"indeterminate":Le,ke=(0,f.A)(g,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),be={},Se={},Ie={};if(ce==="determinate"||ce==="static"){var Ne=2*Math.PI*((C-me)/2);be.strokeDasharray=Ne.toFixed(3),Ie["aria-valuenow"]=Math.round(Me),be.strokeDashoffset="".concat(((100-Me)/100*Ne).toFixed(3),"px"),Se.transform="rotate(-90deg)"}return V.createElement("div",(0,e.A)({className:(0,$.default)(T.root,ze,N!=="inherit"&&T["color".concat((0,O.A)(N))],{determinate:T.determinate,indeterminate:T.indeterminate,static:T.static}[ce]),style:(0,e.A)({width:ne,height:ne},Se,De),ref:Re,role:"progressbar"},Ie,ke),V.createElement("svg",{className:T.svg,viewBox:"".concat(C/2," ").concat(C/2," ").concat(C," ").concat(C)},V.createElement("circle",{className:(0,$.default)(T.circle,Ke&&T.circleDisableShrink,{determinate:T.circleDeterminate,indeterminate:T.circleIndeterminate,static:T.circleStatic}[ce]),style:be,cx:C,cy:C,r:(C-me)/2,fill:"none",strokeWidth:me})))});const fe=(0,te.A)(se,{name:"MuiCircularProgress",flip:!1})(Fe)},31334:(he,k,i)=>{var e,f=i(24994),V=i(6305);e={value:!0},k.A=void 0;var $=V(i(96540)),te=f(i(76447)),O=(0,te.default)($.createElement("path",{d:"M1 21h22L12 2 
11 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");k.A=O},50580:(he,k,i)=>{i.d(k,{A:()=>te});const e="Admin",f="Manager",V="User",te=O=>{let C="";return O===e&&(C="Admin"),O===f&&(C="Manager"),O===V&&(C="User"),C}},95100:(he,k,i)=>{i.d(k,{O:()=>e});const e=f=>{var V;const $=(f==null?void 0:f.unit)||"G,MG,KG,ML,L";let te=f?((V=Object.keys(f))==null?void 0:V.filter(C=>C!=="amount"&&C!=="unit"))||[]:[];const O=[];return $.includes("G")&&(O.push("MG"),O.push("G"),O.push("KG")),$.includes("ML")&&(O.push("ML"),O.push("L")),[...O,...te].join(",")}},41690:(he,k,i)=>{i.d(k,{A:()=>$});var e=i(96540);const f={},$=()=>e.createElement("div",{className:"spinner-container"},e.createElement("div",{className:"spinner"}))},69949:(he,k,i)=>{i.r(k),i.d(k,{default:()=>xt});var e=i(96540),f=i(61225),V=i(61574),$=i(41690),te=i(31334),O=i(73546),C=i(68154),se=i(96746),Fe=i(69312),fe=i(15776),d=i(27606),g=i(84630),Re=i(3148),T=i(94422),ze=i(52706),P=i(72572),N=i(54392),H=i(10413);const Ke={};var ye=i(98752),ne=i(99571),De=i(64810),Ae=i(62051),me=i(83182),Oe=Object.defineProperty,Me=Object.defineProperties,Le=Object.getOwnPropertyDescriptors,ce=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Se=(t,s,a)=>s in t?Oe(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,Ie=(t,s)=>{for(var a in s||(s={}))ke.call(s,a)&&Se(t,a,s[a]);if(ce)for(var a of ce(s))be.call(s,a)&&Se(t,a,s[a]);return t},Ne=(t,s)=>Me(t,Le(s)),Ye=(t,s,a)=>new Promise((h,_)=>{var M=r=>{try{y(a.next(r))}catch(m){_(m)}},b=r=>{try{y(a.throw(r))}catch(m){_(m)}},y=r=>r.done?h(r.value):Promise.resolve(r.value).then(M,b);y((a=a.apply(t,s)).next())});const st=t=>{const[s,a]=(0,e.useState)([]),[h,_]=(0,e.useState)({}),[M,b]=(0,e.useState)(!1),[y,r]=(0,e.useState)(!1),m=M&&y;(0,e.useEffect)(()=>{t.name&&_({name:t.name})},[t.name]),(0,e.useEffect)(()=>{t!=null&&t.paramsRecipeId&&(h!=null&&h.name)&&I(h==null?void 0:h.name)},[t==null?void 0:t.paramsRecipeId,h==null?void 0:h.name]);const G=(R,p)=>{p&&t.onChange(p)},I=R=>Ye(void 0,null,function*(){var p;let Y={index:"recipes",body:{name:'"""'+R+'"""'}},o=yield H.Ay.fuzzySearchFromElasticSearch(Y);if(((p=o==null?void 0:o.result)==null?void 0:p.length)>0){let E=[];o==null||o.result.map(W=>{E.push(W)}),a(E)}}),Q=(R,p)=>Ye(void 0,null,function*(){I(p)}),x=(0,Ae.A)(Q,800);return e.createElement(De.Ay,{id:"size-small-standard",size:"small",value:t.defaultValue,options:s,inputValue:h==null?void 0:h.name,getOptionLabel:R=>{var p;return(p=R==null?void 0:R._source)==null?void 0:p.name},onChange:G,onInputChange:x,loading:m,onOpen:()=>{b(!0)},onClose:()=>{b(!1)},renderInput:R=>e.createElement(P.A,Ne(Ie({},R),{variant:"standard",placeholder:"Enter Recipe Name",InputProps:Ne(Ie({},R.InputProps),{endAdornment:e.createElement(e.Fragment,null,m?e.createElement(me.A,{color:"inherit",size:20}):null,R.InputProps.endAdornment)})}))})},Gt={};var lt=i(90648),rt=i(79764),Ge=i(65594),ot=i(87860),K=i(90652),ct=i(24896),dt=i(24105),He=i(61242),Qe=i(64899),Xe=i(40605),We=i(9197),ut=Object.defineProperty,mt=Object.defineProperties,gt=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,Ze=(t,s,a)=>s in t?ut(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,qe=(t,s)=>{for(var a in s||(s={}))vt.call(s,a)&&Ze(t,a,s[a]);if(Je)for(var a of Je(s))pt.call(s,a)&&Ze(t,a,s[a]);return t},et=(t,s)=>mt(t,gt(s)),Et=(t,s,a)=>new Promise((h,_)=>{var M=r=>{try{y(a.next(r))}catch(m){_(m)}},b=r=>{try{y(a.throw(r))}catch(m){_(m)}},y=r=>r.done?h(r.value):Promise.resolve(r.value).then(M,b);y((a=a.apply(t,s)).next())});const ht=t=>{const s=(0,f.d4)(o=>o.login.active_business),[a,h]=(0,e.useState)([]),[_,M]=(0,e.useState)({}),[b,y]=(0,e.useState)(!1),[r,m]=(0,e.useState)(!1),G=b&&r,{selectedIngredients:I}=t,Q=t.brandId;(0,e.useEffect)(()=>{t.value&&M({name:t.value})},[t.value]);const x=(o,E)=>{E&&(t.onChange&&t.onChange(E),M({name:""}))},R=(o,E)=>Et(void 0,null,function*(){if((0,He.$)(Qe.iW,{"Page Name":"Merchant Recipe","Ingredient Name":E,"Business Id":s,"Recipe Id":window.location.pathname.split("/")[3]}),E&&E.length){m(!0);const W=yield(0,We.searchIngredientsv2)(E,s);if(W){const{lb_products:X,ingredients:de,user_ingredients:w,base_recipe:ge}=W,_e=de.map(c=>({index:"ingredients",indexName:"Raw / Standard Ingredients",id:c.ing_id,name:c.name,unit:c.serving.unit,type:"FOLSOL_INGREDIENT",serving:c.serving,vegNonVegeterian:c.vegNonVegeterian})),Ce=X.map(c=>{var Z,ue,Pe,xe,ve;return{index:"lbproducts",indexName:"Packed Ingredients",id:c.lb_id,name:(ue=(Z=c.details)==null?void 0:Z.products_details)==null?void 0:ue.product_name,unit:"",type:"LABELBLIND_DATABASE",vegNonVegeterian:((ve=(xe=(Pe=c.details)==null?void 0:Pe.ingridients_and_additives)==null?void 0:xe.vegetarian_nonvegetarian_vegan)==null?void 0:ve.trim())||null}}),le=w.map(c=>({index:Xe.A.ES_USER_INGREDIENTS,indexName:"My Ingredients",id:c.uing_id,name:c.productName,unit:"",type:c.type,vegNonVegeterian:c.vegNonVegeterian,mandatoryDeclarations:{aspartame:c.aspartame,aspartame_acesulfame_potassium_salt:c.aspartame_acesulfame_potassium_salt,caffeine_added:c.caffeine_added,erythritol:c.erythritol,monosodium_glutamate:c.monosodium_glutamate,more_polydextrose
1:c.more_polydextrose,more_polyols:c.more_polyols,neotame:c.neotame,non_caloric_sweetener:c.non_caloric_sweetener,plant_stanol_amount:c.plant_stanol_amount,plant_stanols_esters:c.plant_stanols_esters,plant_sterols:c.plant_sterols,saccharins:c.saccharins,steviol_glycoside:c.steviol_glycoside,sucralose:c.sucralose,thaumatin:c.thaumatin}})),L=ge.map(c=>({index:Xe.A.ES_USER_BASE_RECIPE,indexName:"My Base Recipes",id:c.recipe_id,name:c.name,unit:c.recipe_yield_unit,type:c.type,vegNonVegeterian:c.vegNonVegeterian})),re=[..._e,...L,...le,...Ce];h(re),m(!1)}}}),p=(0,Ae.A)(R,1e3),Y=o=>{const E=I==null?void 0:I.map(W=>W.ingredient_name);return E==null?void 0:E.includes(o.name)};return e.createElement(De.Ay,{id:"size-small-standard",size:"small",value:_,options:a,groupBy:o=>o==null?void 0:o.indexName,getOptionLabel:o=>(o==null?void 0:o.name)||"",getOptionDisabled:o=>Y(o),onChange:x,onInputChange:p,loading:G,onOpen:()=>{y(!0)},onClose:()=>{y(!1)},renderInput:o=>e.createElement("div",{style:{display:"flex"}},e.createElement(P.A,et(qe({},o),{style:{flex:"1"},variant:"standard",placeholder:t.label?t.label:"Enter Ingredient Name",InputProps:et(qe({},o.InputProps),{endAdornment:e.createElement(e.Fragment,null,G?e.createElement(me.A,{color:"inherit",size:20}):null,o.InputProps.endAdornment)})})))})};var ft=i(95100),yt=(t,s,a)=>new Promise((h,_)=>{var M=r=>{try{y(a.next(r))}catch(m){_(m)}},b=r=>{try{y(a.throw(r))}catch(m){_(m)}},y=r=>r.done?h(r.value):Promise.resolve(r.value).then(M,b);y((a=a.apply(t,s)).next())});const At=t=>{const s=(0,f.d4)(n=>n.login.lbUserId),a=(0,f.d4)(n=>n.login.name),h=(0,f.d4)(n=>n.login.email),_=(0,f.d4)(n=>n.login.phoneNumber),M=(0,f.d4)(n=>n.login.active_business),b=(0,f.d4)(n=>n.login.business_type),[y,r]=(0,e.useState)([]),[m,G]=(0,e.useState)(!1),[I,Q]=(0,e.useState)(""),[x,R]=(0,e.useState)(""),[p,Y]=(0,e.useState)(""),[o,E]=(0,e.useState)([]),[W,X]=(0,e.useState)(""),[de,w]=(0,e.useState)(""),[ge,_e]=(0,e.useState)(!1),[Ce,le]=(0,e.useState)([]);(0,e.useEffect)(()=>{let n=[];t.ingredients.forEach(u=>{let A={ingredient_name:u.ingredient_name,ingredient_unit:u.ingredient_unit,ingredient_value:(u==null?void 0:u.ingredient_value)||"",unit_lists:u.unit_lists,ingredient_id:u.ingredient_id,ingredient_type:u.ingredient_type};n.push(A)}),E(n),R(t.yieldUnit),Q(t.yieldVal),Y(t.noofServing),E(n)},[t.ingredients]);const L=(n,u,A,ae,v)=>{const pe={edited:n,yieldVal:u,yieldUnit:A,noofServing:ae,ingredients:v};t.handleEditIngredients(pe)};function re(n,u){var A,ae,v;const pe=(A=n==null?void 0:n.serving)!=null&&A.unit?(v=(ae=n==null?void 0:n.serving)==null?void 0:ae.unit)==null?void 0:v.split(","):["g","ml"];let ee;pe.some(Ee=>{if(Ee.toLowerCase()==="g"||Ee.toLowerCase()==="ml")return ee=Ee.toUpperCase(),!0});const Te=(0,ft.O)(n==null?void 0:n.serving),U=[...o];U[u].ingredient_id=n.id,U[u].ingredient_name=n.name,U[u].ingredient_unit=ee,U[u].ingredient_value="",U[u].unit_lists=Te,U[u].ingredient_type=n.type,E(U),L(m,I,x,p,U)}function c(n,u){const A=[...o];A[u].ingredient_unit=n.target.value,E(A),L(m,I,x,p,A)}function Z(n,u){const A=[...o];(/^-?\d*\.?\d?\d$/.test(n.target.value)||n.target.value==="")&&(A[u].ingredient_value=n.target.value,E(A)),L(m,I,x,p,A)}const ue=()=>{const n=[...o];n.push({ingredient_id:null,ingredient_name:null,ingredient_unit:null,ingredient_value:null,ingredient_type:null,unit_lists:null}),E(n),L(m,I,x,p,n)},Pe=(n,u)=>{const A=[...o];A.splice(u,1),E(A),L(m,I,x,p,A)},xe=()=>yt(void 0,null,function*(){if(W){let n={lbUserId:s,details:{business:M,name:a,email:h,phone:_,organisation:b,subject:"Missing Ingredient",message:"I cant find "+W+" ingredient, Please add "+W+" ingredient."},type:"CUSTOM_MAIL"},u={type:"MISSING_INGREDIENT",status:"ACTIVE",details:{ingredient_name:W}};if("success"in(yield H.Ay.addContent(u))){const ae=yield H.Ay.sendCustomEMail(n);w(!0),X("")}else _e(!0)}else return ne.oR.error("Enter ingredeient name!"),!1}),ve=()=>{G(!1),L(!1,I,x,p,o)},q=["g","ml"].join(",");return e.createElement(e.Fragment,null,m?e.createElement(e.Fragment,null,e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,lg:12,sm:12,xs:12},e.createElement(lt.A,{component:Re.A},e.createElement(rt.A,null,e.createElement(ot.A,null,e.createElement(Ge.A,null,e.createElement(K.A,null,"List of Ingredients (to prepare bulk quantity)"," "),e.createElement(K.A,null,"Unit(g/ml)"),e.createElement(K.A,null,"Quantity (All quantities are per 100 g)"),e.createElement(K.A,null),e.createElement(K.A,null))),e.createElement(ct.A,null,o.map((n,u)=>{var A,ae;return e.createElement(Ge.A,{key:u},e.createElement(K.A,{style:{width:"450px"},className:"table-cell"},e.createElement(ht,{key:u,onChange:v=>re(v,u),data:Ce,value:n.ingredient_name,style:{width:"450px"}})),e.createElement(K.A,{className:"table-cell"},e.createElement(P.A,{id:"demo-simple-select",select:!0,value:n.ingredient_unit||"",onChange:v=>c(v,u)},(ae=(A=(n==null?void 0:n.unit_lists)||q)==null?void 0:A.split(","))==null?void 0:ae.map(v=>e.createElement(g.A,{value:(v==null?void 0:v.toUpperCase())||(v==null?void 0:v.toLowerCase())},v==null?void 0:v.toUpperCase())))),e.createElement(K.A,{className:"table-cell"},e.createElement(P.A,{type:"number",name:"ingredient_value",value:n.ingredient_value||"",placeholder:"Ingredient qty",onChange:v=>Z(v,u),inputProps:{step:"0.01",pattern:/^-?\d*\.?\d?\d$/}}
1)),e.createElement(K.A,{className:"table-cell"},e.createElement(se.A,{type:"button",color:"text",variant:"outlined",value:"remove",onClick:v=>Pe(n,u)},"Remove")),u===0?e.createElement(K.A,{className:"table-cell cant-find-moda"},e.createElement(dt.A,{modalClass:"recipe-feedback-modal",triggerClass:"recipe-feedback-btn",triggerText:"Can't find your ingredient?",title:"Send ingredient request"},e.createElement(d.A,{container:!0,direction:"row",spacing:1},e.createElement(d.A,{item:!0,xs:12},e.createElement(P.A,{fullWidth:!0,placeholder:"Enter ingredients name",value:W,onChange:v=>X(v.target.value),style:{marginBottom:"15px",width:"100%"},required:!0})),de?e.createElement(d.A,{item:!0,xs:12},e.createElement("div",{style:{color:"orange"}},"Your ingredient request has been sent successfully!")):null,ge?e.createElement(d.A,{item:!0,xs:12},e.createElement("div",{style:{color:"red"}},"Your ingredient request has not been sent successfully!")):null,e.createElement(d.A,{item:!0,xs:12},e.createElement(se.A,{variant:"contained",color:"primary",onClick:xe},"SEND"))))):e.createElement(K.A,{className:"table-cell"}))}),e.createElement(Ge.A,null,e.createElement(K.A,{colSpan:5},e.createElement(se.A,{type:"button",color:"primary",variant:"contained",value:"add more",onClick:ue},"Add More"),"\xA0\xA0\xA0\xA0",e.createElement(se.A,{type:"button",color:"default",variant:"outlined",value:"skip",onClick:ve},"Skip")))))))),e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,lg:3,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Bulk Quantity prepared (Total Yield)")),e.createElement(d.A,{item:!0,lg:2,sm:2,xs:2},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Quantity"),e.createElement(P.A,{type:"number",id:"recipe-yield",value:I,onChange:n=>{Q(n.target.value),L(m,n.target.value,x,p,o)}})),e.createElement(d.A,{item:!0,lg:2,sm:2,xs:2},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Unit(g/ml)"),e.createElement(P.A,{id:"demo-simple-select",select:!0,value:x||"",onChange:n=>{R(n.target.value),L(m,I,n.target.value,p,o)}},e.createElement(g.A,{value:"G"},"G"),e.createElement(g.A,{value:"ML"},"ML"))),e.createElement(d.A,{item:!0,lg:2,sm:2,xs:2},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"No of Servings"),e.createElement(P.A,{type:"number",id:"recipe-yield",value:p,onChange:n=>{Y(n.target.value),L(m,I,x,n.target.value,o)}})))):e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,lg:12,md:12,sm:12,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"List of Ingredients (to prepare bulk quantity)",e.createElement("br",null),e.createElement("span",{className:"regular-span"},"(per 100 g/ml)"),t.ingredients.length>0?e.createElement(se.A,{className:"edit-button",color:"primary",variant:"contained",onClick:()=>{G(!0),L(!0,I,x,p,o)}},"Edit Ingredients"):null)),t.ingredients?t.ingredients.map((n,u)=>n.ingredient_unit?e.createElement(d.A,{item:!0,sm:3,xs:12,key:u},e.createElement("div",{className:"ingredient-card"},e.createElement("h2",{className:"ingredient-card-title"},n.ingredient_name),e.createElement("h4",{className:"ingredient-card-unit"},"(",parseFloat(n.ingredient_value).toFixed(2)+" "+n.ingredient_unit," ",")"))):e.createElement(d.A,{item:!0,sm:3,xs:12,key:u},e.createElement("div",{className:"ingredient-card"},e.createElement("h2",{className:"ingredient-card-title-1"},n.ingredient_name)))):""))},bt=(0,ye.withLastLocation)(At);var we=i(18722),St=i(50580),Ue=i(5770),It=Object.defineProperty,tt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,nt=(t,s,a)=>s in t?It(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,Ve=(t,s)=>{for(var a in s||(s={}))Nt.call(s,a)&&nt(t,a,s[a]);if(tt)for(var a of tt(s))_t.call(s,a)&&nt(t,a,s[a]);return t},je=(t,s,a)=>new Promise((h,_)=>{var M=r=>{try{y(a.next(r))}catch(m){_(m)}},b=r=>{try{y(a.throw(r))}catch(m){_(m)}},y=r=>r.done?h(r.value):Promise.resolve(r.value).then(M,b);y((a=a.apply(t,s)).next())});const Ct=t=>({lbUserId:t.login.lbUserId,name:t.login.name,email:t.login.email,phoneNo:t.login.phoneNumber,cognitoUserId:t.login.cognitoUserId,subscription:t.subscription.subscriptions[0],plans:t.subscription.plans,businessId:t.login.active_business,recipe_limit_reached:t.subscription.recipe_limit_reached,businessType:t.login.business_type,superAdmin:t.profile.superadminAccess}),Pt=t=>{const[s,a]=(0,e.useState)(we.pv),h=(0,V.W6)(),_=(0,f.d4)(l=>l.login.business_type),M=(0,f.d4)(l=>l.login.lbUserId),b=(0,f.d4)(l=>l.login.active_business),y=(0,f.d4)(l=>l.login.role),[r,m]=(0,e.useState)(""),[G,I]=(0,e.useState)(""),[Q,x]=(0,e.useState)(""),[R,p]=(0,e.useState)(""),[Y,o]=(0,e.useState)(""),[E,W]=(0,e.useState)(""),[X,de]=(0,e.useState)(""),[w,ge]=(0,e.useState)(""),[_e,Ce]=(0,e.useState)([]),[le,L]=(0,e.useState)([]),[re,c]=(0,e.useState)([]),[Z,ue]=(0,e.useState)(""),[Pe,xe]=(0,e.useState)(""),[ve,q]=(0,e.useState)(""),[n,u]=(0,e.useState)(!1),[A,ae]=(0,e.useState)(""),[v,pe]=(0,e.useState)(""),[ee,Te]=(0,e.useState)(""),[U,Ee]=(0,e.useState)(""),[Rt,Dt]=(0,e.useState)(!1),[B,Ot]=(0,e.useState)(""),[J,at]=(0,e.useState)([]),[Mt,Lt]=(0,e.useState)({}
1),Ut=y?(0,St.A)(y):null,Be=new URLSearchParams(t.location.search).get("id");(0,e.useEffect)(()=>{Be&&it({_id:Be})},[Be]);const Vt=()=>Ut==="admin";(0,e.useEffect)(()=>je(void 0,null,function*(){var l,D,j,F;if(_==="Manufacturer")h.push(`${Ue.P.PPF}/user-dashboard/`);else{(0,He.$)(Qe.bJ,{"Page Name":"Create Standard Recipe"}),q(!0);let z=[];if(Vt())z=yield H.Ay.getBrandDetails(b),(l=z==null?void 0:z.result)!=null&&l.items&&at(z.result.items);else{const ie=yield H.Ay.getUserBusinesses(M,b);if(((j=(D=ie==null?void 0:ie.result)==null?void 0:D.items)==null?void 0:j.length)>0){let oe=[];(F=ie==null?void 0:ie.result)==null||F.items.map(S=>{S.businessId!==b&&oe.push({businessId:b,brandId:S.businessId})}),(oe==null?void 0:oe.length)>0&&(z=yield H.Ay.getBatchBrandsDetails({businessData:oe}),z!=null&&z.result&&at(z.result))}}if(t.location.state?t.location.state.recipeId:""){let ie={businessId:b,recipeId:t.location.state.recipeId},S=(yield H.Ay.getUserRecipeDetails(ie)).result.items[0];a((0,we.B2)(S)),Te(S.itemDetails.recipe_yield_unit),pe(S.itemDetails.recipe_yield),Ee(S.itemDetails.no_of_servings),m(S.itemDetails.name),I(S.itemDetails.category),x(S.itemDetails.cuisine),p(S.itemDetails.groups),de(S.itemDetails.serving_size_unit),ge(S.itemDetails.serving_size),o(S.itemDetails.vegNonVegeterian),L(S.itemDetails.ingredients),ue(S.itemDetails.special_declaration),q(!1)}else q(!1)}}),[]);const it=l=>je(void 0,null,function*(){var D,j,F,z,$e,ie,oe;q(!0);const S=yield H.Ay.fetchStandardRecipe(l==null?void 0:l._id);S.success==="success"&&(q(!1),Tt((z=(F=(j=(D=S==null?void 0:S.result)==null?void 0:D.hits)==null?void 0:j.hits)==null?void 0:F[0])==null?void 0:z._source),Lt((oe=(ie=($e=S==null?void 0:S.result)==null?void 0:$e.hits)==null?void 0:ie.hits)==null?void 0:oe[0]))}),Tt=l=>{let D=l.serving.unit,j=[];l.details.ingredients.map((F,z)=>{j.push({ingredient_name:F.ingredient_name,ingredient_value:F.ingredient_value,ingredient_unit:F.ingredient_unit,ingredient_id:F.ingredient_id,ingredient_type:"FOLSOL_INGREDIENT",isChecked:!0,unit_lists:F.unit_lists,disabled:!0})}),I(l.category),m(l.name),x(l.cuisine.charAt(0).toUpperCase()+l.cuisine.slice(1)),p(l.groups),o(l.details.dietCategory),L(j),de(l.serving.unit==="g"||l.serving.unit==="gm"?"g":"ml")},Bt=l=>je(void 0,null,function*(){l.preventDefault();let D,j;if(Rt){if(!w||w===void 0)return ne.oR.error("Serving Size can't be blank"),!1;if(!v||v===void 0)return ne.oR.error("Yield quantity can't be blank."),!1;if(!ee||ee===void 0)return ne.oR.error("Yield unit can't be blank."),!1;if(!U||U===void 0)return ne.oR.error("No of Serving can't be blank."),!1;q(!0),D=Ve({brandId:(J==null?void 0:J.length)===0||(B==null?void 0:B.length)===0?t.businessId:B,businessId:t.businessId,itemDetails:{name:r,category:G,cuisine:Q,meal_course:E,serving_size_unit:X,serving_size:w,ingredients:le,vegNonVegeterian:Y,special_declaration:Z,recipe_yield:v,recipe_yield_unit:ee,no_of_servings:U},metadata:re,status:"PENDING",type:"NEW_RECIPE"},s),j=Ve({brandId:(J==null?void 0:J.length)===0||(B==null?void 0:B.length)===0?t.businessId:B,businessId:t.businessId,name:r,category:G,cuisine:Q,meal_course:E,serving_size_unit:X,serving_size:w,ingredients:le,vegNonVegeterian:Y,special_declaration:Z,recipe_yield:v,recipe_yield_unit:ee,no_of_servings:U,metadata:re,status:"PENDING",type:"NEW_RECIPE"},s)}else{if(!w||w===void 0)return ne.oR.error("Serving Size can't be blank"),!1;q(!0),D=Ve({brandId:(J==null?void 0:J.length)===0||(B==null?void 0:B.length)===0?t.businessId:B,businessId:t.businessId,itemDetails:{name:r,category:G,cuisine:Q,meal_course:E,serving_size_unit:X,serving_size:w,ingredients:le,vegNonVegeterian:Y,special_declaration:Z,recipe_yield:v,recipe_yield_unit:ee,no_of_servings:U},metadata:re,status:"PENDING",type:"NEW_RECIPE"},s),j=D=Ve({brandId:(J==null?void 0:J.length)===0||(B==null?void 0:B.length)===0?t.businessId:B,businessId:t.businessId,name:r,category:G,cuisine:Q,meal_course:E,serving_size_unit:X,serving_size:w,ingredients:le,vegNonVegeterian:Y,special_declaration:Z,recipe_yield:v,recipe_yield_unit:ee,no_of_servings:U,metadata:re,status:"PENDING",type:"NEW_RECIPE"},s)}try{if(t.location.state){D.id=t.location.state.recipeId;let F=yield(0,We.updateRecipev2)(t.location.state.recipeId,j);h.push({pathname:`${Ue.P.MENU_LABEL}/recipe/nutrition-list/`,state:{businessId:b,recipeId:F.data.recipe_id}})}else{let z=(yield(0,We.createRecipev2)(j)).data.recipe_id;h.push({pathname:`${Ue.P.MENU_LABEL}/recipe/nutrition-list/`,state:{businessId:b,recipeId:z}})}q(!1)}catch(F){h.push({pathname:`${Ue.P.MENU_LABEL}/recipe/`})}}),Ft=l=>{l&&(Dt(l.edited),pe(l.yieldVal),Te(l.yieldUnit),Ee(l.noofServing),L(l.ingredients),zt(l.ingredients))},zt=l=>{l.forEach(D=>{D&&D.allergens&&Ce([..._e,...D.allergens])})};return e.createElement("div",null,e.createElement(C.m,null,e.createElement("title",null,"FoLSol\xAE| Add Recipe"),e.createElement("meta",{name:"description",content:"Add Recipe Description"})),ve?e.createElement($.A,null):null,n?e.createElement("div",{className:"message-drawer"},e.createElement("div",{className:"message-drawer-text"},e.createElement(te.A,{className:"warning-icon"}),A,e.createElement(O.A,{className:"closeIcon",onClick:u(!1)}))):null,e.createElement("div",null,e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,xs:12}
1,e.createElement(Re.A,{className:"add-recipe-tab p-2"},e.createElement("h2",{className:"add-recipe-heading"},"Add Recipe"),e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,sm:3,xs:12},J&&J.length>1?e.createElement(e.Fragment,null,e.createElement(N.A,{variant:"subtitle1"},"Select Brands"),e.createElement(P.A,{id:"demo-simple-select-brands",select:!0,value:(B==null?void 0:B.length)>0?B:"",onChange:l=>Ot(l.target.value)},J.map((l,D)=>e.createElement(g.A,{value:l.id,key:D},l.name)))):null)),e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Recipe Name"),e.createElement(st,{onChange:it,name:r,paramsRecipeId:Be,defaultValue:Mt})),e.createElement(d.A,{item:!0,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Category"," "),e.createElement(P.A,{disabled:!0,id:"category",value:G,onChange:l=>I(l.target.value)})),e.createElement(d.A,{item:!0,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Cuisine"),e.createElement(P.A,{disabled:!0,select:!0,id:"demo-simple-select",value:Q,onChange:l=>x(l.target.value)},e.createElement(g.A,{value:"Chinese"},"Chinese"),e.createElement(g.A,{value:"Continental"},"Continental"),e.createElement(g.A,{value:"Global Fusion"},"Global Fusion"),e.createElement(g.A,{value:"Italian"},"Italian"),e.createElement(g.A,{value:"North Indian"},"North Indian"),e.createElement(g.A,{value:"Other Indian"},"Other Indian"),e.createElement(g.A,{value:"South Indian"},"South Indian"),e.createElement(g.A,{value:"Thai"},"Thai"),e.createElement(g.A,{value:"Others"},"Others"))),e.createElement(d.A,{item:!0,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Food Group"),e.createElement(P.A,{id:"demo-simple-select",disabled:!0,value:R,onChange:l=>p(l.target.value),InputProps:{readOnly:!!R}}))),e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Serving Size Unit (g/ml)"),e.createElement(P.A,{id:"serving-size",disabled:!0,select:!0,value:X,InputProps:{readOnly:!!X},onChange:l=>de(l.target.value)},e.createElement(g.A,{value:"g"},"G"),e.createElement(g.A,{value:"ml"},"ML"))),e.createElement(d.A,{item:!0,sm:3,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Quantity per serve (Serving size)"),e.createElement(P.A,{id:"demo-simple-select",type:"number",value:w,onChange:l=>ge(l.target.value)})),e.createElement(d.A,{item:!0,sm:6,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Meal Type"),e.createElement(Fe.A,{component:"fieldset",className:"cuisine meal-type"},e.createElement(ze.A,{row:!0,"aria-label":"position",name:"position",value:Y},e.createElement(fe.A,{disabled:!0,value:"Vegetarian",control:e.createElement(T.A,{color:"primary",onChange:l=>o(l.target.value)}),label:"Vegetarian"}),e.createElement(fe.A,{value:"NonVegetarian",disabled:!0,control:e.createElement(T.A,{color:"primary",onChange:l=>o(l.target.value)}),label:"Non-Vegetarian"}),e.createElement(fe.A,{value:"Vegan",disabled:!0,control:e.createElement(T.A,{color:"primary",onChange:l=>o(l.target.value)}),label:"Vegan (No animal products including milk, honey)"}))))),e.createElement(bt,{ingredients:le,yieldVal:v,yieldUnit:ee,noofServing:U,handleEditIngredients:Ft}),e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,sm:8,xs:12},e.createElement("h3",null,"Mandatory Declarations"),e.createElement("br",null),e.createElement("h4",null,"Does The Recipe Contain"),e.createElement("br",null),e.createElement(we.Ay,{mandatoryDeclaration:s,setMandatoryDeclaration:a}))),e.createElement(d.A,{container:!0,spacing:3},e.createElement(d.A,{item:!0,sm:8,xs:12},e.createElement(N.A,{variant:"subtitle1",className:"textbox-heading"},"Special Declaration by Chef"),e.createElement(P.A,{id:"special-declaration",value:Z,onChange:l=>ue(l.target.value)}),e.createElement("small",{className:"declaration"},"(Mention your cooking style, special ingredients or any other information about your recipe that you want to convey to your customer)")),e.createElement(d.A,{item:!0,xs:12},e.createElement(se.A,{variant:"contained",color:"primary",onClick:Bt}," ","Calculate Nutrition Value")),e.createElement(d.A,{item:!0,xs:12},e.createElement(N.A,{className:"declaration"},"*FoLSol\xAEdoes not endorse the reuse of cooking oil"),e.createElement(N.A,{className:"declaration"},"*Ingredient List and Nutrition Calculations are done on the basis of standardised recipes. Any deviation from recipe must be mentioned separately by the food service operator."," "))))))))},xt=(0,ye.withLastLocation)((0,V.y)((0,f.Ng)(Ct)(Pt)))}}]);

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.