(() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));

  // src/shared/version.js
  var require_version = __commonJS({
    "src/shared/version.js"(exports, module) {
      (function attachBuildIdentity(root, factory) {
        const api = factory();
        if (typeof module === "object" && module.exports) module.exports = api;
        root.TfaBuildIdentity = api;
      })(typeof globalThis === "object" ? globalThis : exports, function createBuildIdentity() {
        "use strict";
        const EXTENSION_VERSION = "1.25.34";
        const injectedFingerprint = true ? "ad6e691b8aca11ed33afdee80003f6267e631e774c668aa45122b2917e7c7890" : "";
        const fingerprint = injectedFingerprint || `source:${EXTENSION_VERSION}`;
        return Object.freeze({ version: EXTENSION_VERSION, fingerprint });
      });
    }
  });

  // src/content/frame-input-runtime.js
  var require_frame_input_runtime = __commonJS({
    "src/content/frame-input-runtime.js"(exports, module) {
      (function attachFrameInputRuntime(root, factory) {
        const api = factory();
        if (typeof module === "object" && module.exports) module.exports = api;
        root.TfaFrameInputRuntime = api;
      })(typeof globalThis === "object" ? globalThis : exports, function createFrameInputRuntime() {
        "use strict";
        const MIDDLE_DRAG_THRESHOLD_SQUARED = 6 * 6;
        const MIDDLE_DRAG_SCROLL_MULTIPLIER = 3;
        const OWNER_KEY = Symbol.for("tfa.frame-input-runtime.v1.controller");
        function start({ windowRef, identity } = {}) {
          const activeWindow = windowRef || (typeof window === "object" ? window : null);
          if (!activeWindow) throw new Error("TfaFrameInputRuntime requires a window");
          if (activeWindow === activeWindow.top) return false;
          const build = identity || activeWindow.TfaBuildIdentity || {};
          const fingerprint = String(build.fingerprint || `legacy:${build.version || "unknown"}`);
          const previousOwner = activeWindow[OWNER_KEY];
          if (previousOwner) {
            if (previousOwner.fingerprint === fingerprint) return true;
            if (typeof previousOwner.stop !== "function") return true;
            previousOwner.stop();
          }
          const generation = Math.max(0, Number(previousOwner?.generation) || 0) + 1;
          let middleGesture = null;
          let stopped = false;
          const shouldSuppressAlt = (event) => event.isTrusted !== false && event.key === "Alt";
          const forwardMiddleEvent = (type, event) => {
            activeWindow.parent.postMessage({
              __tfa_fwd: true,
              type,
              ...event ? { button: event.button, clientX: event.clientX, clientY: event.clientY } : {}
            }, "*");
          };
          const cancelMiddleGesture = () => {
            if (!middleGesture) return false;
            middleGesture = null;
            forwardMiddleEvent("middlecancel");
            return true;
          };
          function handleKeydown(event) {
            if (shouldSuppressAlt(event)) {
              event.preventDefault();
              event.stopPropagation();
              event.stopImmediatePropagation();
            }
            activeWindow.parent.postMessage({
              __tfa_fwd: true,
              type: "keydown",
              key: event.key,
              code: event.code,
              altKey: event.altKey,
              ctrlKey: event.ctrlKey,
              shiftKey: event.shiftKey,
              metaKey: event.metaKey,
              repeat: event.repeat
            }, "*");
          }
          function handleKeyup(event) {
            if (shouldSuppressAlt(event)) {
              event.preventDefault();
              event.stopPropagation();
              event.stopImmediatePropagation();
            }
            activeWindow.parent.postMessage({
              __tfa_fwd: true,
              type: "keyup",
              key: event.key,
              code: event.code,
              altKey: event.altKey,
              ctrlKey: event.ctrlKey,
              shiftKey: event.shiftKey,
              metaKey: event.metaKey
            }, "*");
          }
          function handleMousedown(event) {
            if (event.button !== 1) return;
            event.preventDefault();
            middleGesture = { startX: event.clientX, startY: event.clientY, lastY: event.clientY, dragged: false };
            forwardMiddleEvent("mousedown", event);
          }
          function handleMousemove(event) {
            if (!middleGesture) return;
            event.preventDefault();
            const previousY = middleGesture.lastY;
            if (!middleGesture.dragged) {
              const dx = event.clientX - middleGesture.startX;
              const dy = event.clientY - middleGesture.startY;
              middleGesture.dragged = dx * dx + dy * dy > MIDDLE_DRAG_THRESHOLD_SQUARED;
            }
            middleGesture.lastY = event.clientY;
            if (middleGesture.dragged) {
              const scrollY = (event.clientY - previousY) * MIDDLE_DRAG_SCROLL_MULTIPLIER;
              if (scrollY) activeWindow.scrollBy(0, scrollY);
            }
            forwardMiddleEvent("mousemove", event);
          }
          function handleMouseup(event) {
            if (event.button !== 1 || !middleGesture) return;
            event.preventDefault();
            middleGesture = null;
            forwardMiddleEvent("mouseup", event);
          }
          function handleAuxclick(event) {
            if (event.button !== 1) return;
            event.preventDefault();
            event.stopPropagation();
          }
          function handleBlur() {
            cancelMiddleGesture();
          }
          const listeners = [
            ["keydown", handleKeydown, true],
            ["keyup", handleKeyup, true],
            ["mousedown", handleMousedown, true],
            ["mousemove", handleMousemove, true],
            ["mouseup", handleMouseup, true],
            ["auxclick", handleAuxclick, true],
            ["blur", handleBlur, void 0]
          ];
          const controller = {
            fingerprint,
            generation,
            stop() {
              if (stopped) return false;
              stopped = true;
              cancelMiddleGesture();
              for (const [type, handler, capture] of listeners) {
                activeWindow.removeEventListener(type, handler, capture);
              }
              activeWindow.removeEventListener("pagehide", handlePagehide);
              if (activeWindow[OWNER_KEY] === controller) delete activeWindow[OWNER_KEY];
              return true;
            }
          };
          function handlePagehide(event) {
            if (event && event.persisted === true) {
              cancelMiddleGesture();
              return;
            }
            controller.stop();
          }
          activeWindow[OWNER_KEY] = controller;
          for (const [type, handler, capture] of listeners) activeWindow.addEventListener(type, handler, capture);
          activeWindow.addEventListener("pagehide", handlePagehide);
          return true;
        }
        function stop({ windowRef } = {}) {
          const activeWindow = windowRef || (typeof window === "object" ? window : null);
          const controller = activeWindow && activeWindow[OWNER_KEY];
          return !!(controller && typeof controller.stop === "function" && controller.stop());
        }
        return Object.freeze({ start, stop });
      });
    }
  });

  // src/content/frame-bridge-entry.js
  var require_frame_bridge_entry = __commonJS({
    "src/content/frame-bridge-entry.js"() {
      var import_version = __toESM(require_version());
      var import_frame_input_runtime = __toESM(require_frame_input_runtime());
      if (window !== window.top) {
        globalThis.TfaFrameInputRuntime.start({
          windowRef: window,
          identity: globalThis.TfaBuildIdentity
        });
      }
    }
  });
  require_frame_bridge_entry();
})();
