"use strict";Liferay.Loader.define("@liferay!analytics-settings-web$testing-library/dom@8.20.0/dist/label-helpers",["module","exports","require","./helpers"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.getLabelContent=getLabelContent,t.getLabels=function getLabels(e,t,{selector:n="*"}={}){const r=t.getAttribute("aria-labelledby"),l=r?r.split(" "):[];return l.length?l.map((t=>{const n=e.querySelector(`[id="${t}"]`);return n?{content:getLabelContent(n),formControl:null}:{content:"",formControl:null}})):Array.from(getRealLabels(t)).map((e=>({content:getLabelContent(e),formControl:Array.from(e.querySelectorAll("button, input, meter, output, progress, select, textarea")).filter((e=>e.matches(n)))[0]})))},t.getRealLabels=getRealLabels;var r=n("./helpers");const e=["button","meter","output","progress","select","textarea","input"];function getTextContent(t){return e.includes(t.nodeName.toLowerCase())?"":t.nodeType===r.TEXT_NODE?t.textContent:Array.from(t.childNodes).map((e=>getTextContent(e))).join("")}function getLabelContent(e){let t;return t="label"===e.tagName.toLowerCase()?getTextContent(e):e.value||e.textContent,t}function getRealLabels(e){var t;if(void 0!==e.labels)return null!=(t=e.labels)?t:[];if(!function isLabelable(e){return/BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(e.tagName)||"INPUT"===e.tagName&&"hidden"!==e.getAttribute("type")}(e))return[];const n=e.ownerDocument.querySelectorAll("label");return Array.from(n).filter((t=>t.control===e))}}}));
//# sourceMappingURL=label-helpers.js.map