PageSourceSearch

https://hearclear-rebuild-2.emergent.host/static/js/4856.d1649311.chunk.js

js hearclear-rebuild-2.emergent.host collected 2026-10-03 03:24:40 UTC 12,523 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[4856],{87023(e,t,s){s.d(t,{GJ:()=>c,J5:()=>o,Jp:()=>n,V7:()=>l,e5:()=>i});const a=[3,6,9,12,18,24],l=1e4,n=[3,6,9,12],r=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:14;if(0===s)return Math.ceil(e/t);const a=s/12/100,l=e*a*Math.pow(1+a,t)/(Math.pow(1+a,t)-1);return Math.ceil(l)},i=e=>{if(e<3e3)return null;if(e>=l){const t=Math.min(12,...n);return{amount:Math.ceil(e/t),tenure:t,isNoCost:!0}}return{amount:r(e,6,14),tenure:6,isNoCost:!1}},c=e=>{if(e<3e3)return[];const t=[];return a.forEach(s=>{if(e>=l&&n.includes(s))t.push({tenure:s,emi:Math.ceil(e/s),totalAmount:e,interest:0,isNoCost:!0,label:"".concat(s," months No-Cost EMI")});else{const a=r(e,s,14),l=a*s,n=l-e;t.push({tenure:s,emi:a,totalAmount:l,interest:n,isNoCost:!1,label:"".concat(s," months @ 14% p.a.")})}}),t},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(e);return"".concat(s,t?"/mo (No Cost)":"/mo")}},94856(e,t,s){s.d(t,{$$:()=>j,RS:()=>u,o0:()=>p});var a=s(65043),l=s(56099),n=s(60241),r=s(36210),i=s(92382),c=s(15711),o=s(86376),d=s(57856),m=s(87023),x=s(70579);const h=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(e||0),u=e=>{let{price:t,className:s=""}=e;const a=(0,m.e5)(t);if(!a)return null;if(t>=m.V7){const e=Math.max(...m.Jp),a=Math.ceil(t/e);return(0,x.jsxs)("div",{className:"flex items-center gap-1.5 text-xs ".concat(s),"data-testid":"emi-badge",children:[(0,x.jsx)(o.A,{className:"h-3.5 w-3.5 text-emerald-600"}),(0,x.jsxs)("span",{className:"text-slate-600",children:["No Cost EMI ",(0,x.jsxs)("span",{className:"font-semibold text-emerald-700",children:["\u20b9",a.toLocaleString("en-IN"),"/mo"]})]})]})}return(0,x.jsxs)("div",{className:"flex items-center gap-1.5 text-xs ".concat(s),"data-testid":"emi-badge",children:[(0,x.jsx)(o.A,{className:"h-3.5 w-3.5 text-emerald-600"}),(0,x.jsxs)("span",{className:"text-slate-600",children:["EMI from ",(0,x.jsx)("span",{className:"font-semibold text-emerald-700",children:(0,m.J5)(a.amount,a.isNoCost)})]})]})},p=e=>{let{price:t,productName:s="this product"}=e;const[l,n]=(0,a.useState)(!1),[r,h]=(0,a.useState)(12),u=(0,m.GJ)(t),p=(0,m.e5)(t);if(!p||0===u.length)return null;const N=u.find(e=>e.tenure===r)||u[0],j=t>=m.V7;return(0,x.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-teal-50 rounded-xl p-4 border border-emerald-200","data-testid":"emi-calculator",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>n(!l),children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[(0,x.jsx)("div",{className:"w-10 h-10 bg-emerald-100 rounded-lg flex items-center justify-center",children:(0,x.jsx)(o.A,{className:"h-5 w-5 text-emerald-600"})}),(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("span",{className:"font-semibold text-slate-900",children:"EMI Available"}),j&&(0,x.jsx)("span",{className:"bg-emerald-600 text-white text-xs px-2 py-0.5 rounded-full",children:"No Cost EMI"})]}),(0,x.jsxs)("p",{className:"text-sm text-slate-600",children:["Starting from ",(0,x.jsx)("span",{className:"font-bold text-emerald-700",children:(0,m.J5)(p.amount,p.isNoCost)})]})]})]}),(0,x.jsx)("button",{className:"p-2 hover:bg-emerald-100 rounded-lg transition-colors",children:l?(0,x.jsx)(c.A,{className:"h-5 w-5"}):(0,x.jsx)(i.A,{className:"h-5 w-5"})})]}),l&&(0,x.jsxs)("div",{className:"mt-4 pt-4 border-t border-emerald-200",children:[(0,x.jsx)("p",{className:"text-sm font-medium text-slate-700 mb-3",children:"Select EMI Tenure:"}),(0,x.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-2 mb-4",children:u.map(e=>(0,x.jsxs)("button",{onClick:()=>h(e.tenure),className:"p-2 rounded-lg border-2 transition-all text-center ".concat(r===e.tenure?"border-emerald-500 bg-emerald-50":"border-slate-200 hover:border-emerald-300"),children:[(0,x.jsx)("div",{className:"text-sm font-bold text-slate-900",children:e.tenure}),(0,x.jsx)("div",{className:"text-xs text-slate-500",children:"months"}),e.isNoCost&&(0,x.jsx)("div",{className:"text-[10px] text-emerald-600 font-medium",children:"No Cost"})]},e.tenure))}),(0,x.jsxs)("div",{className:"bg-white rounded-lg p-4 border",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,x.jsx)("span",{className:"text-slate-600",children:"Monthly EMI"}),(0,x.jsx)("span",{className:"text-2xl font-bold text-emerald-700",children:new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(N.emi)})]}),(0,x.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,x.jsxs)("div",{className:"flex justify-between",children:[(0,x.jsx)("span",{className:"text-slate-500",children:"Product Price"}),(0,x.jsx)("span",{className:"text-slate-700",children:new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(t)})]}),(0,x.jsxs)("div",{className:"flex justify-between",children:[(0,x.jsx)("span",{className:"text-slate-500",children:"Interest"}),(0,x.jsx)("span",{className:N.isNoCost?"text-emerald-600 font-medium":"text-slate-700",children:N.isNoCost?"FREE":new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(N.interest)})]}),(0,x.jsxs)("div",{className:"flex justify-between pt-2 border-t",children:[(0,x.jsx)("span",{className:"font-medium text-slate-700",children:"Total Amount"}),(0,x.jsx)("span",{className:"font-bold text-slate-900",children:new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(N.totalAmount)})]})]})]}),(0,x.jsxs)("div",{className:"mt-4 flex items-start gap-2",children:[(0,x.jsx)(d.A,{className:"h-4 w-4 text-slate-400 mt-0.5 shrink-0"}),(0,x.jsxs)("p",{className:"text-xs text-slate-500",children:["EMI available on HDFC, ICICI, SBI, Axis, Kotak, Bajaj Finserv & more credit cards.",j&&" No-cost EMI on select tenures."]})]})]})]})};const N=e=>{let{option:t,accent:s,isSelected:a,total:n,onToggle:i}=e;return(0,x.jsxs)("button",{type:"button",onClick:i,className:"relative w-full text-left rounded-xl border-2 p-3 pt-4 transition-all hover:shadow-sm ".concat(a?"no-cost"===s?"border-emerald-500 bg-emerald-50 ring-2 ring-emerald-200":"border-blue-500 bg-blue-50 ring-2 ring-blue-200":"border-slate-200 bg-white hover:border-slate-300"),"data-testid":"emi-plan-".concat(t.tenure),children:[t.isNoCost&&(0,x.jsxs)("span",{className:"absolute -top-2 left-1/2 -translate-x-1/2 inline-flex items-center gap-1 bg-emerald-600 text-white text-[9px] font-bold uppercase tracking-wide px-2 py-0.5 rounded-full shadow-sm whitespace-nowrap",children:[(0,x.jsx)(l.A,{className:"h-2.5 w-2.5"})," No Cost"]}),(0,x.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,x.jsxs)("span",{className:"text-sm font-semibold text-slate-900",children:[t.tenure,"m"]}),a&&(0,x.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-emerald-700",children:[(0,x.jsx)(r.A,{className:"h-3 w-3"}),"Selected"]})]}),(0,x.jsxs)("div",{className:"mt-0.5 text-base font-bold text-slate-900 leading-tight",children:[h(t.emi),(0,x.jsx)("span",{className:"text-[10px] font-normal text-slate-500",children:" /mo"})]}),(0,x.jsx)("div",{className:"mt-0.5 text-[10px] text-slate-500 leading-tight",children:t.isNoCost?(0,x.jsx)("span",{className:"text-emerald-700 font-medium",children:"0% interest"}):(0,x.jsx)("span",{children:"~14% p.a."})})]})},j=e=>{let{total:t,value:s,onChange:r,className:i=""}=e;const c=(0,a.useMemo)(()=>(0,m.GJ)(t),[t]),o=(0,a.useMemo)(()=>(0,m.e5)(t),[t]),[u,p]=(0,a.useState)(!1);if(!c.length||t<1e4)return null;const j=c.filter(e=>e.isNoCost),f=c.filter(e=>!e.isNoCost),b=s&&c.find(e=>e.tenure===s.tenure),g=u?f:f.slice(0,2);return(0,x.jsxs)("div",{className:"rounded-2xl border border-emerald-200 bg-gradient-to-br from-emerald-50 via-white to-teal-50 p-4 ".concat(i),"data-testid":"cart-emi-selector",children:[(0,x.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,x.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,x.jsx)("div",{className:"h-9 w-9 rounded-lg bg-emerald-600 text-white flex items-center justify-center shadow-sm",children:(0,x.jsx)(n.A,{className:"h-5 w-5"})}),(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("p",{className:"font-semibold text-slate-900 leading-tight",children:"Pay in easy EMIs"}),(0,x.jsxs)("span",{className:"inline-flex items-center gap-1 bg-emerald-100 text-emerald-800 text-[10px] font-bold uppercase tracking-wide px-2 py-0.5 rounded-full","data-testid":"no-cost-emi-available-badge",children:[(0,x.jsx)(l.A,{className:"h-3 w-3"}),"No-Cost EMI Available"]})]}),(0,x.jsxs)("p",{className:"text-xs text-slate-600 mt-0.5",children:["From ",(0,x.jsx)("span",{className:"font-semibold text-emerald-700",children:(0,m.J5)(o.amount,o.isNoCost)})," on HDFC, ICICI, SBI, Axis, Kotak, Bajaj Finserv & more."]})]})]})}),j.length>0&&(0,x.jsxs)("div",{className:"mt-4",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,x.jsx)("p",{className:"text-xs font-bold uppercase tracking-wide text-emerald-800",children:"Zero-Cost EMI \xb7 0% Interest"}),(0,x.jsx)("span",{className:"text-[10px] text-slate-500",children:"Select a plan"})]}),(0,x.jsx)("div",{className:"grid grid-cols-2 gap-2.5","data-testid":"emi-no-cost-grid",children:j.map(e=>{const s=b&&b.tenure===e.tenure;return(0,x.jsx)(N,{option:e,accent:"no-cost",isSelected:s,total:t,onToggle:()=>r&&r(s?null:e)},e.tenure)}
1)})]}),f.length>0&&(0,x.jsxs)("div",{className:"mt-4",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,x.jsx)("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-600",children:"Standard EMI \xb7 Lower monthly outflow"}),f.length>2&&(0,x.jsx)("button",{type:"button",onClick:()=>p(e=>!e),className:"text-[11px] font-semibold text-blue-700 hover:text-blue-800","data-testid":"toggle-standard-emi",children:u?"Show fewer":"Show all (".concat(f.length,")")})]}),(0,x.jsx)("div",{className:"grid grid-cols-2 gap-2.5","data-testid":"emi-standard-grid",children:g.map(e=>{const s=b&&b.tenure===e.tenure;return(0,x.jsx)(N,{option:e,accent:"standard",isSelected:s,total:t,onToggle:()=>r&&r(s?null:e)},e.tenure)})})]}),b&&(0,x.jsxs)("div",{className:"mt-4 rounded-xl p-4 border ".concat(b.isNoCost?"bg-emerald-600 text-white border-emerald-700":"bg-slate-900 text-white border-slate-800"),"data-testid":"emi-selected-breakdown",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs uppercase tracking-wide opacity-80 font-semibold",children:"Your EMI Plan"}),(0,x.jsxs)("p",{className:"mt-1 text-2xl font-bold leading-tight",children:[h(b.emi),(0,x.jsx)("span",{className:"text-sm font-normal opacity-80",children:" /month"})]}),(0,x.jsxs)("p",{className:"mt-0.5 text-xs opacity-90",children:["for ",b.tenure," months",b.isNoCost?(0,x.jsx)("span",{className:"ml-1.5 font-semibold",children:"\xb7 No interest"}):(0,x.jsx)("span",{className:"ml-1.5",children:"\xb7 ~14% p.a. interest"})]})]}),(0,x.jsxs)("div",{className:"text-right",children:[(0,x.jsx)("p",{className:"text-xs uppercase tracking-wide opacity-80 font-semibold",children:"You pay"}),(0,x.jsx)("p",{className:"mt-1 text-xl font-bold",children:h(b.totalAmount)}),!b.isNoCost&&(0,x.jsxs)("p",{className:"text-xs opacity-80",children:["incl. ",h(b.interest)," interest"]}),b.isNoCost&&(0,x.jsx)("p",{className:"text-xs opacity-90 font-medium",children:"Same as cart total \xb7 No extra cost"})]})]}),(0,x.jsxs)("p",{className:"mt-3 text-[11px] opacity-90 flex items-start gap-1.5",children:[(0,x.jsx)(d.A,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),"Final EMI plan and bank are confirmed at Razorpay payment \u2014 your selection above is carried forward for a smoother checkout."]})]}),!b&&(0,x.jsxs)("p",{className:"mt-3 text-[11px] text-slate-500 flex items-start gap-1.5",children:[(0,x.jsx)(d.A,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),"Tap a plan to lock in your monthly EMI. Cart total stays the same \u2014 EMI just spreads the payment."]})]})}}}]);
2//# sourceMappingURL=4856.d1649311.chunk.js.map

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.