import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var s in o)t.o(o,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(s={getContext:()=>e.getContext,store:()=>e.store},a={},t.d(a,s),a);var s,a;(0,o.store)("woocommerce/dropdown",{state:{get selectValue(){const{storeNamespace:e}=(0,o.getContext)(),t=(0,o.store)(e),s=(Array.isArray(t.state.selectableItems)?t.state.selectableItems:[]).find(e=>e.selected);return s?.value??""}},actions:{onDropdownChange(e){const t=e.currentTarget;if(!(t instanceof HTMLSelectElement))return;const{storeNamespace:s}=(0,o.getContext)(),a=(0,o.store)(s),r=t.value;if(""===r){const e=(Array.isArray(a.state.selectableItems)?a.state.selectableItems:[]).find(e=>e.selected);return void(e&&"function"==typeof a.actions.toggle&&a.actions.toggle(e))}const n=(Array.isArray(a.state.selectableItems)?a.state.selectableItems:[]).find(e=>e.value===r);var c;(c=n)&&"string"==typeof c.value&&c.value.length>0&&!c.disabled&&!c.hidden?a.actions.toggle(n):"function"==typeof a.actions.navigate&&a.actions.navigate()}}},{lock:!0});