function WidgetfocusWidgetForNode(e){for(;e&&!e.__widget;)e=e.parentNodeOrShadowHost();if(!e)return;let t=e.__widget;for(;t._parentWidget;)t._parentWidget._defaultFocusedChild=t,t=t._parentWidget}function XWidgetfocusWidgetForNode(e){e=e&&e.parentNodeOrShadowHost();const t=customElements.get("x-widget");let o=null;for(;e;)e instanceof t&&(o&&(e._defaultFocusedElement=o),o=e),e=e.parentNodeOrShadowHost()}export function focusChanged(e){const t=e.target,o=t?t.ownerDocument:null,d=o?o.deepActiveElement():null;WidgetfocusWidgetForNode(d),XWidgetfocusWidgetForNode(d)}