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