import*as t from"@wordpress/interactivity";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const r=(a={getContext:()=>t.getContext,store:()=>t.store},i={},e.d(i,a),i),o=t=>t.replace(/^attribute_(pa_)?/,"").replace(/-/g," ").toLowerCase(),{state:n}=(0,r.store)("woocommerce/products",{state:{products:{},productVariations:{},findProduct({id:t,selectedAttributes:e}){const r=n.productVariations[t];if(r)return r;const a=n.products[t];if(!a)return null;if("variable"!==a.type||!e?.length)return a;const i=a.variations?.find(t=>t.attributes.every(t=>{const r=e.find(e=>{return r=t.name,n=e.attribute,o(r)===o(n);var r,n});return null===t.value?void 0!==r&&null!==r.value:r?.value===t.value}));return i?n.productVariations[i.id]??null:null},get mainProductInContext(){const t=(0,r.getContext)("woocommerce/products"),e=t&&"productId"in t?t.productId:n.productId;return e?n.products[e]??null:null},get productVariationInContext(){const t=(0,r.getContext)("woocommerce/products"),e=t&&"variationId"in t?t.variationId:n.variationId;return e?n.productVariations[e]??null:null},get productInContext(){return n.productVariationInContext||n.mainProductInContext}}},{lock:"I acknowledge that using a private store means my plugin will inevitably break on the next store release."});var a,i;