import { AGENT_CANCELED, USER_CANCELED } from "../clark-fsm.js";
export const transitionFrom = (clark) => {
    return (event) => {
        if (clark.context.abortController?.signal.aborted &&
            event.type !== USER_CANCELED &&
            event.type !== AGENT_CANCELED) {
            // abort signal was not explicitly handled by previous state
            return clark.send({ type: USER_CANCELED });
        }
        return clark.send(event);
    };
};
//# sourceMappingURL=transition.js.map