"use strict";(globalThis.webpackChunkwoocommerce_product_options=globalThis.webpackChunkwoocommerce_product_options||[]).push([[608],{6661:(t,e,a)=>{a.d(e,{default:()=>n});const n=(()=>{let t;return{init:function(){t=Array.from(document.querySelectorAll('.wpo-field-checkbox, .wpo-field-text_labels, .wpo-field-image_buttons, .wpo-field-product[data-type="checkbox"], .wpo-field-product[data-type="image_buttons"]')).map(t=>({element:t,inputElements:t.querySelectorAll('input[type="checkbox"]'),minQty:t.dataset?.maxQty?parseInt(t.dataset.minQty):null,maxQty:t.dataset?.maxQty?parseInt(t.dataset.maxQty):null})),t.filter(t=>t.maxQty).forEach(t=>{t.inputElements.forEach(e=>{e.addEventListener("change",e=>{!function(t,e){const a=Array.from(e.inputElements).filter(t=>t.checked);1===e.maxQty&&a.length>e.maxQty&&a.filter(e=>e!==t.srcElement).forEach(t=>{t.checked=!1,t.dispatchEvent(new Event("change"))})}(e,t)})})})}}})()}}]);