import{asArray as r}from"./array.js";import{parentAutofocusables as n}from"./DOMutils.js";var o=function(r,n){return void 0===n&&(n=[]),n.push(r),r.parentNode&&o(r.parentNode,n),n},t=function(r,n){for(var t=o(r),e=o(n),f=0;f<t.length;f+=1){var i=t[f];if(e.indexOf(i)>=0)return i}return!1},e=function(n,o,e){var f=r(n),i=r(o),u=f[0],a=!1;return i.filter(Boolean).forEach((function(r){a=t(a||r,r)||a,e.filter(Boolean).forEach((function(r){var n=t(u,r);n&&(a=!a||n.contains(a)?n:t(n,a))}))})),a},f=function(r){return r.reduce((function(r,o){return r.concat(n(o))}),[])};export{f as allParentAutofocusables,t as getCommonParent,e as getTopCommonParent};
//# sourceMappingURL=parenting.js.map
