Build 543408stable
Module 298072
498 characters · in 0473e5d4df31547c.js, 5da18c020a0b15d0.jsDependencies
Source Raw
function(e,t,s){s.d(t,{Q:()=>c,n:()=>d});var n=s(942381),a=s(265690),i=s(312852),l=s(623373);let r=(0,a.h)(()=>({selectionStates:new Map}),n.x),c=e=>{let t=(0,i.K)(e),s=r(t=>null!=e&&(0,l.B1)(e)?t.selectionStates.get(e.storeListingId)?.selectedVariantIndex:null);return null!=s?Math.max(0,s):t},d=(e,t)=>{r.setState(s=>{let n=s.selectionStates.get(e.storeListingId);return n?.selectedVariantIndex===t?s:{selectionStates:new Map(s.selectionStates).set(e.storeListingId,{selectedVariantIndex:t})}})}}