(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{2448:function(e,t,r){Promise.resolve().then(r.bind(r,4404)),Promise.resolve().then(r.bind(r,7640)),Promise.resolve().then(r.bind(r,239)),Promise.resolve().then(r.bind(r,4524)),Promise.resolve().then(r.bind(r,5576)),Promise.resolve().then(r.bind(r,7223)),Promise.resolve().then(r.bind(r,3247)),Promise.resolve().then(r.bind(r,5613)),Promise.resolve().then(r.bind(r,4680)),Promise.resolve().then(r.bind(r,1426)),Promise.resolve().then(r.bind(r,975)),Promise.resolve().then(r.bind(r,4512)),Promise.resolve().then(r.bind(r,3182)),Promise.resolve().then(r.bind(r,3810)),Promise.resolve().then(r.bind(r,2498)),Promise.resolve().then(r.bind(r,356)),Promise.resolve().then(r.bind(r,5935)),Promise.resolve().then(r.bind(r,9246)),Promise.resolve().then(r.bind(r,9002)),Promise.resolve().then(r.bind(r,3705)),Promise.resolve().then(r.bind(r,5019)),Promise.resolve().then(r.bind(r,5664)),Promise.resolve().then(r.t.bind(r,6291,23)),Promise.resolve().then(r.t.bind(r,8173,23)),Promise.resolve().then(r.t.bind(r,231,23)),Promise.resolve().then(r.t.bind(r,4080,23)),Promise.resolve().then(r.bind(r,2918)),Promise.resolve().then(r.t.bind(r,3054,23)),Promise.resolve().then(r.t.bind(r,4193,23)),Promise.resolve().then(r.bind(r,4369)),Promise.resolve().then(r.bind(r,3101))},2918:function(e,t,r){"use strict";r.d(t,{default:function(){return f}});var n=r(7437),a=r(2265),l=r(1444),i=r(2588),s=r(2868),o=r(6804),c=r(1116),d=r(6621),u=r(6616);let m=(0,o.UY)({app:d.ZP.reducer,cart:u.ZP.reducer}),h=(0,c.xC)({reducer:m});function f(e){let{children:t}=e;return(0,n.jsxs)(l.zt,{store:h,children:[(0,n.jsxs)(a.Suspense,{fallback:(0,n.jsx)("div",{className:"w-full h-screen flex justify-center items-center",children:(0,n.jsx)("div",{className:"w-6 h-6 border-[3px] border-t-white border-[#0D3F27] rounded-full animate-spin self-center"})}),children:[t,(0,n.jsx)(s.d$,{}),(0,n.jsx)(s.f6,{schema:{name:"Truly Kerala",description:"Discover the finest Kerala style banana chips, best Kerala wafers, and whole green cardamom at TrulyKerala. Shop authentic Kerala food products online.",email:"trulykerala@gmail.com",logo:"/Truly-kerala-logo.png",telephone:"+91 98959 81814",url:"https://trulykerala.com",address:{addressCountry:"India",addressLocality:"Kerala",addressRegion:"Kochi",postalCode:"682021",streetAddress:"23/1448, Ground Floor - Sapthagiri Arcade, EMS Road, Padamugal, Thrikkakara PO"}}})]}),(0,n.jsx)(i.Ix,{autoClose:5e3})]})}},4369:function(e,t,r){"use strict";r.d(t,{default:function(){return d}});var n=r(7437),a=r(2265),l=r(9381),i=r(4245);let s=i.Ry().shape({name:i.Z_().required("Please enter your name").min(3).matches(/^[a-zA-Z ]{2,30}$/,"Name must not contain any numbers or special characters"),company:i.Z_().required("Please enter your company name").min(3),email:i.Z_().required("Please enter your email").email("Please enter a valid email").matches(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/,"Please enter a valid email"),mobile:i.Z_().required("Please enter your mobile number").matches(/^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$/,"Please enter a valid mobile number"),message:i.Z_().required("Please enter your message").min(5)});var o=r(5097),c=r(55);function d(e){let{className:t,buttonClassName:r,title:i}=e,d=(0,a.useRef)(null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.J9,{onSubmit:function(e,t){let{resetForm:r,setSubmitting:n}=t;c.Xo.post("form-trulykerala-contactform-1",e).then(()=>{var e;r(),n(!1),null==d||null===(e=d.current)||void 0===e||e.showModal()}).catch(e=>{c.BF.error("There was a problem while submitting the message"),n(!1)})},validationSchema:s,initialValues:{name:"",email:"",mobile:"",company:"",whatsapp:"",message:""},children:e=>{let{isSubmitting:a}=e;return(0,n.jsxs)(l.l0,{className:"w-full py-5 md:px-5 ".concat(t),children:[i&&(0,n.jsx)("h2",{className:"text-center font-bold text-2xl md:text-3xl pb-7 pt-5",children:i}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"w-auto flex flex-col md:flex-row",children:[(0,n.jsxs)("div",{className:"flex flex-col w-full",children:[(0,n.jsx)(l.gN,{type:"text",placeholder:"Name",name:"name",className:"bg-[#ffffff42] text-black border-[1px] border-solid border-[#00000038] rounded-md focus:border-[#000000] transition duration-300 placeholder:text-gray-600 px-5 py-2 m-2 outline-none"}),(0,n.jsx)(l.Bc,{className:"ml-2 text-sm text-red-500",name:"name",component:"div"}),(0,n.jsx)(l.gN,{type:"email",placeholder:"E mail",name:"email",className:"bg-[#ffffff42] text-black border-[1px] border-solid border-[#00000038] rounded-md focus:border-[#000000] transition duration-300 placeholder:text-gray-600 px-5 py-2 m-2 outline-none"}),(0,n.jsx)(l.Bc,{className:"ml-2 text-sm text-red-500",name:"email",component:"div"})]}),(0,n.jsxs)("div",{className:"flex flex-col flex-2 w-full",children:[(0,n.jsx)(l.gN,{type:"text",placeholder:"Company",name:"company",className:"bg-[#ffffff42] text-black border-[1px] border-solid border-[#00000038] rounded-md focus:border-[#000000] transition duration-300 placeholder:text-gray-600 px-5 py-2 m-2 outline-none"}),(0,n.jsx)(l.Bc,{className:"ml-2 text-sm text-red-500",name:"company",component:"div"}),(0,n.jsx)(l.gN,{type:"text",placeholder:"Phone",name:"mobile",className:"bg-[#ffffff42] text-black border-[1px] border-solid border-[#00000038] rounded-md focus:border-[#000000] transition duration-300 placeholder:text-gray-600 px-5 py-2 m-2 outline-none"}),(0,n.jsx)(l.Bc,{className:"ml-2 text-sm text-red-500",name:"mobile",component:"div"})]})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col",children:[(0,n.jsx)(l.gN,{component:"textarea",placeholder:"Message",name:"message",className:"bg-[#ffffff42] flex-1 text-black border-[1px] border-solid border-[#00000038] rounded-md focus:border-[#000000] transition duration-300 placeholder:text-gray-600 px-5 py-2 m-2 outline-none"}),(0,n.jsx)(l.Bc,{className:"ml-2 text-sm text-red-500",name:"message",component:"div"})]})]}),(0,n.jsxs)("div",{className:"flex items-center px-2 mt-5 flex-col-reverse md:flex-row",children:[(0,n.jsx)("span",{className:"flex-1 mt-5 md:mt-0 text-sm text-gray-600",children:"We'll get back to you within 24 hours."}),(0,n.jsx)("button",{type:"submit",className:"".concat(r," px-10 py-2 rounded-md transition duration-300 disabled:bg-gray-400 disabled:cursor-not-allowed"),disabled:a,children:a?"Submitting...":"Submit"})]})]})}}),(0,n.jsxs)("dialog",{ref:d,className:"global-dialog flex flex-col items-center justify-center",children:[(0,n.jsx)(o.GcF,{}),(0,n.jsx)("h3",{className:"mb-5 text-2xl font-semibold text-center",children:"Thank You for your feedback!"}),(0,n.jsx)("form",{method:"dialog",children:(0,n.jsx)("button",{className:"bg-yellow-300 px-9 py-1 rounded-lg hover:bg-yellow-200 hover:shadow-lg transition duration-300",children:"OK"})})]})]})}},3101:function(e,t,r){"use strict";r.d(t,{default:function(){return h}});var n=r(7437),a=r(6648),l=r(7138),i=r(2265),s=r(55);function o(){return(0,n.jsx)("svg",{fill:"none",viewBox:"0 0 15 15",height:"2em",width:"2em",children:(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.5 3a.5.5 0 000 1h12a.5.5 0 000-1h-12zM1 7.5a.5.5 0 01.5-.5h12a.5.5 0 010 1h-12a.5.5 0 01-.5-.5zm0 4a.5.5 0 01.5-.5h12a.5.5 0 010 1h-12a.5.5 0 01-.5-.5z",clipRule:"evenodd"})})}var c=r(2579),d=r(9524),u=r(6854),m=r(1109);function h(){let{cartCount:e}=(0,c.h)();(0,d.V)();let t=(0,u.c)(),[r,h]=(0,i.useState)(!1),[f,x]=(0,i.useState)(!0),[p,g]=(0,i.useState)(0),[b,v]=(0,i.useState)([]),[y,j]=(0,i.useState)(!1);function w(){h(!1)}return(0,i.useEffect)(()=>{s._7.getAllProductCategories().then(e=>{v(e)})},[]),(0,i.useEffect)(()=>{let e=()=>{let e=window.scrollY;e<p||0===e?x(!0):(x(!1),r&&h(!1)),g(e)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[p,r]),(0,n.jsx)("nav",{className:"fixed w-full flex items-center justify-center z-50 ".concat(f?"translate-y-0":"-translate-y-[175%]"," transition-transform duration-300 ease-in-out"),children:(0,n.jsx)("div",{className:"flex items-center justify-center w-full shadow-xl bg-white m-5 rounded-md",children:(0,n.jsxs)("section",{className:"flex flex-col lg:flex-row w-full min-h-20 justify-between max-w-7xl transition-[max-height] duration-300 ".concat(r?"max-h-max":"max-h-20"),children:[(0,n.jsxs)("section",{className:"flex items-center justify-between mt-[10px] lg:mt-0",children:[(0,n.jsx)(l.default,{href:"/",children:(0,n.jsx)(a.default,{src:"/Truly-kerala-logo.png",alt:"logo",width:125,height:125,className:"w-16 lg:w-20 p-1 md:p-2 ml-3 lg:ml-5",loading:"eager",fetchPriority:"high",priority:!0,quality:100})}),(0,n.jsx)("button",{title:"menu",onClick:function(){h(!r)},className:"p-1 mr-3 lg:mr-0 rounded-md transition-colors duration-200 lg:hidden active:bg-slate-200",children:(0,n.jsx)(o,{})})]}),(0,n.jsxs)("ul",{className:"relative text-md flex flex-col lg:flex-row gap-6 items-center justify-center transition-opacity duration-300 text-[#2E5F38] font-medium mb-6 lg:mb-0 ".concat(r?"opacity-100 lg:opacity-100":"opacity-0 hidden lg:flex lg:opacity-100"),children:[(0,n.jsx)("li",{onClick:w,children:(0,n.jsx)(l.default,{href:"/",children:"HOME"})}),(0,n.jsx)("li",{onClick:w,children:(0,n.jsx)(l.default,{href:"/about",children:"ABOUT US"})}),(0,n.jsx)("li",{onClick:w,children:(0,n.jsx)(l.default,{href:"/banana-chips",children:"BANANA CHIPS"})}),(0,n.jsx)("li",{onClick:w,children:(0,n.jsx)(l.default,{href:"/cardamom",children:"CARDAMOM"})}),(0,n.jsxs)("li",{className:"p-3 md:p-0 hover:text-gray-500 transition-colors duration-300 relative group ".concat(y?"lg:group-hover:block":""),children:[(0,n.jsx)("span",{className:"cursor-pointer lg:group-hover:block",onClick:function(){j(e=>!e)},children:"SHOP"}),(0,n.jsxs)("ul",{className:"absolute top-full left-0 flex-col bg-[#FAFFB3] shadow-lg rounded z-50 py-2 transition-all duration-300 ".concat(y?"flex":"hidden lg:group-hover:flex"),children:[b&&b.length?b.map(e=>(0,n.jsx)("li",{className:"px-6 py-2 hover:text-[#2f6e3b] w-max",onClick:()=>{w(),j(!1)},children:(0,n.jsx)(l.default,{href:"/category/".concat(e.slug),children:e.name})},e.id)):null,(0,n.jsx)("li",{className:"px-6 py-2 hover:text-[#2f6e3b] w-max",onClick:w,children:(0,n.jsx)(l.default,{href:"/all-products",children:"All Products"})})]})]}),(0,n.jsx)("li",{onClick:w,children:(0,n.jsx)(l.default,{href:"/our-story",children:"OUR STORY"})}),(0,n.jsx)("li",{onClick:w,children:(0,n.jsx)(l.default,{href:"/contact",children:"CONTACT US"})}),(0,n.jsxs)(l.default,{href:"/checkout".concat(t?"?cartId=".concat(t):""),className:"p-5 md:p-2 mr-6 relative rounded-full bg-[#FCFF45]",title:"Checkout",onClick:w,children:[(0,n.jsx)(m.qk2,{size:30}),(0,n.jsx)("span",{className:"absolute p-1 top-1 right-0 min-w-4 h-4 flex justify-center items-center rounded-full bg-[#2f6e3b] text-white text-xs",children:e})]})]})]})})})}},2579:function(e,t,r){"use strict";r.d(t,{h:function(){return d}});var n=r(2265),a=r(6463),l=r(8637),i=r(2377),s=r(1354),o=r(6854);let c=(0,r(7785).z)({mode:"production"}),d=()=>{var e;let[{isLoading:t,list:r},{addOrUpdateCart:d,clearCart:u}]=(0,s.jD)(),{shippingAddress:m}=(0,i.z)(),h=(0,o.c)(),f=(0,a.useRouter)(),x=(0,a.usePathname)(),p=new l.gq,g=(0,n.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,n=await d({productId:e,variantId:r,quantity:t});return n&&p.success("Item added to cart successfully"),n},[d]),b=(0,n.useCallback)(async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;await d({id:e,quantity:r,productId:t})},[d]);return{handleAddToCart:g,handleClearCart:(0,n.useCallback)(async()=>{u({})},[u]),handleDeleteCart:b,handleCheckout:(0,n.useCallback)(()=>{null==m?f.push("/shipping".concat(h?"?cartId=".concat(h):"")):(0,l.ci)(null==r?void 0:r.id).then(e=>{let{sessionId:t,orderId:r}=e.data;t&&c.then(e=>{e.checkout({paymentSessionId:t,redirectTarget:"_modal",customerDetails:{name:m.name,phone:m.mobile,email:m.email}}).then(e=>{e.error&&p.error("Payment failed or cancelled"),e.paymentDetails&&f.replace("".concat("https://trulykerala.com","/order?orderId=").concat(r))})}).catch(()=>p.error("Failed to get order, Try again"))}).catch(()=>p.error("Please try again"))},[r,x]),isCartUpdating:t,cartCount:(null==r?void 0:null===(e=r.lineItems)||void 0===e?void 0:e.length)||0,list:r,shippingAddress:(null==r?void 0:r.shippingAddress)||null}}},6854:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var n=r(6463),a=r(55);function l(){let e=(0,n.useSearchParams)().get("cartId")||"";return e&&""!==e?e:new a.cQ.BrowserPersistence().getItem("cartId")}},9524:function(e,t,r){"use strict";r.d(t,{V:function(){return i}});var n=r(2265),a=r(1354),l=r(6854);let i=()=>{let[{isLoading:e,list:t},{fetchCart:r}]=(0,a.jD)(),i=(0,l.c)();return(0,n.useEffect)(()=>{r(i)},[i]),{isLoading:e,list:t}}},2377:function(e,t,r){"use strict";r.d(t,{z:function(){return l}});var n=r(2265),a=r(1354);let l=()=>{let[{list:e}]=(0,a.jD)(),[t,r]=(0,n.useState)(!1);return{isEdit:t,toggleEdit:(0,n.useCallback)(()=>{r(e=>!e)},[]),list:e,shippingAddress:(null==e?void 0:e.shippingAddress)||null}}},1372:function(e,t,r){"use strict";r.r(t),r.d(t,{addOrUpdateCart:function(){return d},clearCart:function(){return m},clearCartId:function(){return p},deleteCart:function(){return u},fetchCart:function(){return c},retrieveCartId:function(){return f},saveCartId:function(){return x},setShippingAddress:function(){return h}});var n=r(1116);let a=(0,n.PH)("cart/setLoading"),l=(0,n.PH)("cart/setCart"),i=(0,n.PH)("cart/unSetLoader"),s=(0,n.PH)("cart/unSetCart");var o=r(55);let c=(0,n.hg)("cart/fetchCart",async(e,t)=>{let{dispatch:r}=t;try{if(r(a()),!e){r(s());return}let t=await o.y1.getCart(e);return x(String(e)),(null==t?void 0:t.id)?r(l(t)):(r(i()),await p()),t}catch(e){r(i())}}),d=(0,n.hg)("cart/createCart",async(e,t)=>{let{dispatch:r}=t;try{r(a());let t=await f();if(!t){let t=await o.y1.createCart(e);return(null==t?void 0:t.id)&&(await x(String(t.id)),r(l(t))),r(i()),null==t?void 0:t.id}let n=await o.y1.updateCart(t,e);return(null==n?void 0:n.id)&&r(l(n)),r(i()),t}catch(e){return console.error("Failed to add or update cart:",e),r(i()),null}}),u=(0,n.hg)("cart/deleteCart",async(e,t)=>{let{dispatch:r}=t;try{r(a());let t=await f();if(void 0==t)return;let n=await o.y1.deleteCart(t);if(null==n?void 0:n.id){let t={...n,lineItems:n.lineItems.filter(t=>t.id!=e.productId)};r(l(t))}return r(i()),n}catch(e){r(i())}}),m=(0,n.hg)("cart/clearCart",async(e,t)=>{let{dispatch:r}=t,n=await f();void 0!=n&&(await o.y1.deleteCart(n),r(s()),r(i()),await p())}),h=(0,n.hg)("cart/setShippingAddress",async(e,t)=>{let{dispatch:r}=t;try{r(a());let t=await f();if(void 0==t)return;let n=await o.y1.setShippingAddress(t,e);return(null==n?void 0:n.id)&&r(l(n)),r(i()),n}catch(e){return r(i()),e}});async function f(){return new o.cQ.BrowserPersistence().getItem("cartId")}async function x(e){return new o.cQ.BrowserPersistence().setItem("cartId",e)}async function p(){return new o.cQ.BrowserPersistence().removeItem("cartId")}},1354:function(e,t,r){"use strict";r.d(t,{jD:function(){return d}});var n=r(2265),a=r(1444),l=r(6804);let i=e=>"function"==typeof e?l.DE:s,s=(e,t)=>Object.entries(e).reduce((e,r)=>{let[n,a]=r,l=i(a);return e[n]=l(a,t),e},{}),o=e=>{let{getState:t,actions:r}=e,l=(0,a.v9)(t),i=(0,a.I0)();return[l,(0,n.useMemo)(()=>({...s(r,i)}),[i,r])]};var c=r(6616);let d=()=>{let[e,t]=o({getState:c.y0,actions:c.Nw});return[e,t]};r(6621)},6621:function(e,t,r){"use strict";let n=(0,r(1116).oM)({name:"app",initialState:{searchModal:!1,cartModal:!1},reducers:{toggleSearch(e,t){e.searchModal=t.payload},toggleCart(e,t){e.cartModal=t.payload}}});n.actions,t.ZP=n},6616:function(e,t,r){"use strict";r.d(t,{Nw:function(){return s},y0:function(){return i}});var n=r(1116),a=r(1372);let l=(0,n.oM)({name:"cart",initialState:{cartModal:!1,isLoading:!1,list:null},reducers:{toggleCart(e,t){e.cartModal=t.payload},setCart(e,t){e.list=t.payload,e.isLoading=!1},setLoading(e){e.isLoading=!0},unSetCart(e){e.list=null,e.isLoading=!1},unSetLoader(e){e.isLoading=!1}}}),i=e=>e.cart,s={...l.actions,...a};t.ZP=l},8637:function(e,t,r){"use strict";r.d(t,{gq:function(){return o},Nn:function(){return i},ci:function(){return l},ys:function(){return c}});var n=r(8472);let a="https://client-api.leadmetrics.ai/api/client/v1/",l=e=>n.Z.post("".concat(a,"carts/").concat(e,"/checkout"),{},{headers:{"Api-Key":"ed45612de6fa461781ba5cfb232c9723"}}),i=e=>n.Z.put("".concat(a,"orders/").concat(e,"/Status"),{},{headers:{"Api-Key":"ed45612de6fa461781ba5cfb232c9723"}});var s=r(2588);class o{success(e){s.Am.success(e)}constructor(){this.error=function(e){s.Am.error(e)}}}let c=()=>n.Z.get("".concat("https://client-api.leadmetrics.ai/api/client/v1/","locale/countries"))},3054:function(){}},function(e){e.O(0,[5182,9141,6990,5706,2516,1159,231,873,5536,8173,1444,3153,9381,1175,8299,2971,7023,1744],function(){return e(e.s=2448)}),_N_E=e.O()}]);