import {
  CLAIMED_MODES
} from "./chunk-V6OJGLBA.js";

// src/wu-state-cloud.ts
var BRANCH_PR_MODE = CLAIMED_MODES.BRANCH_PR;
var BRANCH_ONLY_MODE = CLAIMED_MODES.BRANCH_ONLY;
var WORKTREE_EDIT_MODE = "worktree";
var BRANCH_PR_EDIT_MODE = "branch-pr";
var BLOCKED_EDIT_MODE = "blocked";
function shouldUseBranchPrStatePath(doc) {
  return doc.claimed_mode === BRANCH_PR_MODE;
}
function resolveInProgressEditMode(claimedMode) {
  if (claimedMode === BRANCH_PR_MODE) {
    return BRANCH_PR_EDIT_MODE;
  }
  if (claimedMode === BRANCH_ONLY_MODE) {
    return BLOCKED_EDIT_MODE;
  }
  return WORKTREE_EDIT_MODE;
}
function shouldUseBranchPrDeletePath(docs) {
  return docs.some((doc) => shouldUseBranchPrStatePath(doc));
}

export {
  BRANCH_PR_EDIT_MODE,
  BLOCKED_EDIT_MODE,
  shouldUseBranchPrStatePath,
  resolveInProgressEditMode,
  shouldUseBranchPrDeletePath
};
