When President Trump indelibly called African countries “shitholes” (or perhaps “shithouses”) in a White House meeting Thursday, he wasn’t just ranting. He was criticizing a proposed immigration deal struck by a bipartisan group of US senators — the only bipartisan proposal so far that could provide a solution for the 690,000 unauthorized immigrants facing the end of the Deferred Action for Childhood Arrivals (DACA) program in time to avoid a government shutdown at the end of this week.

Sens. Lindsey Graham (R-SC) and Dick Durbin (D-IL) reportedly left the meeting horrified by Trump’s comments ... then proceeded to continue trying to gather congressional support for the deal Trump had just panned.

Even after Trump’s temper tantrum Thursday (and his tweets over the weekend declaring a DACA deal “dead” and blaming Durbin), most observers agree that, just as he promised in a televised meeting last Tuesday, Trump will sign a bill that gets to his desk.

Getting it there, through both chambers of Congress, is the tricky part.

There are still some big questions about the Graham-Durbin proposal. They haven’t released bill text or even a one-pager. But on balance — if the most recent reports are accurate — it’s a left-of-center compromise.

It would slightly decrease the number of people coming into the US legally each year and give Trump the resources to start his “wall” in exchange for substantially increasing the number of current immigrants — both legal and unauthorized — eligible for permanent legal status.

If that doesn’t address the concerns of enough members of Congress, they can keep negotiating — or perhaps an alternative framework will arise that can be more broadly supported, maybe from the working group of congressional leaders like Senate Majority Leader John Cornyn (R-TX), Senate Minority Whip Durbin, House Majority Leader Kevin McCarthy (R-CA), and House Minority Whip Steny Hoyer (D-MD).

The White House may not be satisfied with the Durbin-Graham proposal, but that raises the question of what it would endorse that could still get 60 votes in the Senate.

Graham and Durbin are betting that as the deadline nears, congressional leadership’s desire to get the DACA issue off the table will override their reluctance to support a deal without political cover from the president. It’s possible that an alternative proposal might materialize, but for now, the Graham-Durbin framework is the only game in town.

What we know about the Graham-Durbin immigration framework

The framework that Sens. Graham and Durbin agreed to, along with Sens. Michael Bennet (D-CO), Jeff Flake (R-AZ), Cory Gardner (R-CO), and Bob Menendez (D-NJ), covers the four areas that the White House and congressional leaders agreed to after Tuesday’s meeting: a DACA fix, a wall, restrictions on “chain migration,” and an end to the diversity visa lottery program.

For the most part, though, the proposal finds the least disruptive way possible to satisfy those demands. It eliminates the “lottery” part of the diversity visa lottery but retaining some support for the “diversity” part. It gives access to legal status and green cards to DACA recipients (and those who would have qualified for the program) and to immigrants who are facing the loss of their Temporary Protected Status under the Trump administration. And it limits “chain migration” only for parents of DREAMers legalized under the bill — not by slashing family-based immigration more broadly.

Young unauthorized immigrants who came to the US as children would get legal status — and eventual citizenship. The deal would allow hundreds of thousands (potentially, depending on the details, a million or more) of unauthorized immigrants who came to the US as children, and meet educational and criminal requirements, to apply for provisional legal status in the US. After a certain number of years, they’d be eligible to apply for green cards — and after another three or five years, like other green card holders, they would be able to apply for US citizenship.

The qualifications for immigrants to legalize haven’t yet been released in detail; according to reports, they represent a compromise between the DREAM Act, supported by Democrats and some Republicans, and a Republican alternative called the SUCCEED Act.

Legalization wouldn’t just be open to the 690,000 immigrants who were protected under the DACA program when Trump started winding it down in September; it would also include immigrants who qualified for DACA and never applied (or whose protections expired without renewal), or who meet the requirements set forward in the bill, as well as immigrants under 15 who weren’t able to apply for DACA. And unlike DACA, it would be permanent.

It prevents “chain migration” by barring DREAMers from sponsoring their parents. Under the Graham-Durbin proposal, parents of DREAMers would be allowed to get a form of legal status that could be renewed every few years — but that would not, by itself, make them eligible for green cards. They wouldn’t be able to get green cards through their children who would be legalized under this bill, either.

This is the big open question about the whole framework — one that could make the difference in a few million unauthorized immigrants becoming US citizens.

According to some reports, the bill would place a restriction on the immigrant parents rather than the (eventual US citizen) children, making it impossible for them to get sponsored for green cards through their kids. In one respect, that could be more punitive toward millions of immigrants than current law.

Currently, the five million native-born US citizens with at least one unauthorized parent (many of whom also have DREAMers in their families) are able to sponsor their parents once they turn 21; if parents were banned from green cards categorically, a US-born child with a DREAMer older sister would never be able to sponsor her parents for green cards.

But other observers familiar with the talks say that possibility has been rejected, and that the restriction would only be on DREAMers sponsoring their parents — not on native-born citizens sponsoring them.

These immigrants would (eventually) be eligible for green cards under current law anyway — as long as they’re not permanently barred from legal status because of their immigration history. But the Graham-Durbin proposal would give them a form of legal status to bridge the gap until they could become citizens. If the reports of a more permissive “chain migration” fix are true, it would make the bill unequivocally dovish in its approach to current unauthorized immigrants.

The diversity visa lottery would be eliminated, and those 50,000 visas would be reallocated. When President Trump started going after the “visa lottery” after a failed terrorist attack in New York, it made a certain amount of sense: Republicans had been railing for a while against the idea of handing visas out by lottery instead of merit. Many Democrats are willing to give that up if those visas are used for other things they want — though the Congressional Black Caucus is very worried about the impact on African countries, which tend to benefit the most from the visa lottery.

The Trump administration is moving aggressively to end temporary legal protection for hundreds of thousands of immigrants who’ve been in the US for years or decades, while calling on Congress to solve the problem with a permanent solution.

The proposed DACA deal would kill two birds with one stone. It would eliminate the visa lottery. But instead of just allowing 50,000 fewer immigrants into the US legally each year, it would reallocate those visas. Some of them would go to immigrants from underrepresented countries, just on a non-lottery basis (such as holding spots for underrepresented countries in current visa categories); other visas would go to immigrants who currently have TPS, opening the door for them to apply for green cards.

A few billion dollars for the border. NBC’s Leigh Ann Caldwell reported that the deal as presented to Trump would have included $1.6 billion for physical barriers (which Caldwell called a fence but the White House would probably call a wall), surveillance tech, and agent training — and another $1.2 billion for “other priorities” on border security. Those numbers are roughly in line with what the White House asked for a single year on the border in its 2017 supplemental funding requests, and Sen. Tom Cotton (R-AR) dismissively characterized them as only funding the wall “for a year.”

There’s some room for negotiation in this framework — but not a ton

“I expect there will be more negotiations,” Graham said to the Washington Post Monday. “We wrote a proposal that over time, we can make it better.”

Maybe.

The problem is that in addition to the balancing act of any compromise — that making the bill more conservative might lose liberal votes, and vice versa — the Graham-Durbin proposal doesn’t have a ton of room for policy negotiation without opening up a much bigger can of worms than can be resolved in a single four-day week, or even the month that Congress could buy by passing another short-term continuing resolution to keep the government open.

On the left, House Democrats are frustrated that the deal gives Trump any semblance of “wall” funding — Rep. Joe Crowley (D-NY), the chair of the House Democratic Caucus, told the Post it’s “not a deal I could support” — and that it was put together without their involvement.

On the right, some conservatives are concerned that the deal doesn’t provide enough money for the border — Sens. Thom Tillis (R-NC) and James Lankford (R-OK) claim to have left the bipartisan negotiations over this issue. Reportedly, Republicans including Cornyn are also stressing the importance of tightening asylum laws as a means to “secure the border,” given how many of the people apprehended by Border Patrol in recent years have been Central American asylum seekers (often children or families).

Cotton, a leading immigration hawk, appears especially frustrated that the bill doesn’t do more to restrict family-based legal immigration — for example, eliminating the lower-priority visa categories that allow adult children and siblings of US citizens to come to the US. Those categories are the main targets of opponents to “chain migration,” but getting rid of them would create a couple of big policy headaches.

Legislators would have to figure out what to do with the millions of people who’ve applied for those visas but are stuck in backlogs due to annual limits. They’d have to decide whether the visas should be given to other people — and which sort of other people — or eliminated entirely, as they are in Cotton’s RAISE Act.

Ultimately, though, immigration hawks’ objections to the Graham-Durbin deal are holistic. They think the DACA fix should instead come from Rep. Bob Goodlatte (R-VA)’s immigration bill — which essentially attaches legalization for DACA recipients, with no pathway to a green card, to an omnibus of immigration enforcement proposals including mandatory use of the E-Verify program to check the legal status of all workers.

That bill is a nonstarter for Democrats — and it’s probably not the bill that moderate Republicans want, either.

There is no “shithole countries” compromise

No one in Congress appears to be discussing how to make an immigration deal address the complaints Trump made at the Thursday meeting. He didn’t want a bill that allowed Haitian immigrants to stay in the US, and he wanted more immigration from countries like Norway (and, according to some reports, Asia) and fewer from “shithole” (or “shithouse”) African countries.

There’s no discussion about addressing those complaints because those aren’t actually complaints about immigration policy.

Trump complained about the “lottery” part of the diversity visa lottery, so the Graham-Durbin group eliminated it — but it turned out that, at least as of Thursday, his real problem was with some of the countries it benefits.

You can’t make a deal that preserves diversity visa slots for Norway (which currently qualifies) but not for Namibia, on the basis that Trump doesn’t like Namibia. You can’t make a deal that provides green cards to Salvadorans with TPS but not to Haitians, because Trump wants Haitians to leave.

It’s impossible to negotiate with the White House right now because it’s impossible to know which White House will show up. It’s all but certain that Trump, in a vacuum, would have agreed to this deal — in fact, he “expressed pleasure” with it in a Thursday morning phone call with Durbin, according to the Post.

But key White House advisers, including Stephen Miller, legislative director Marc Short, and Chief of Staff John Kelly, didn’t like that deal. And it’s not clear what deal they would support. Republicans in Congress blamed Miller for trying to blow up negotiations last week; no White House official has told Congress what the White House’s real deal breakers are, pointing instead to a five-page list of demands issued in October and a $19 billion, 10-year plan for the border wall.

The only real option the White House has is to veto the bill — would Trump really do that and cause a government shutdown?

Without any guidance from hawks or the White House about what a bipartisan alternative to Graham-Durbin would look like, it’s hard to imagine that anyone in Congress will be able to come up with a deal between now and Friday. If Democrats decide to block any funding bill until DACA is addressed, and if Republican leadership decides that avoiding a shutdown is more important than their qualms over an immigration bill — both of which are big ifs — Graham-Durbin will go from a legislative outcast to an emergency bipartisan win.