import { Feature as i } from "../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/Feature.es.js";
import { pipe as s } from "../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/pipe.es.js";
import { addDomEvent as e } from "../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/events/add-dom-event.es.js";
class a extends i {
  constructor() {
    super(...arguments), this.isActive = !1;
  }
  onFocus() {
    let t = !1;
    try {
      t = this.node.current.matches(":focus-visible");
    } catch {
      t = !0;
    }
    !t || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
  }
  onBlur() {
    !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
  }
  mount() {
    this.unmount = s(e(this.node.current, "focus", () => this.onFocus()), e(this.node.current, "blur", () => this.onBlur()));
  }
  unmount() {
  }
}
export {
  a as FocusGesture
};
//# sourceMappingURL=focus.es.js.map
