Washington Nationals second baseman Daniel Murphy celebrates in a “Made for October” t-shirt after the Nats clinched the National League Eastern Division Championship last month in Pittsburgh. (Charles Leclaire/Usa Today Sports)

At an undisclosed manufacturing facility in Northern Virginia on Tuesday night, a crew was watching the Washington Nationals game in Los Angeles with special interest. When the last out was recorded — giving the Dodgers a win, tying the series and forcing a Game 5 back in the District — they started their machines.

What the crew began making was a line of products that can’t officially exist unless and until the Nats vanquish the Dodgers entirely: $35 T-shirts, $40 caps and $75 hoodies, all bearing the certified logo of the Nationals as 2016 National League Division Series winners. It’s one of the lesser known nail-biters of professional sports championships — the super-secret last-minute drill faced by team merchandise managers eager to satisfy playoff-giddy fans with open wallets.

According to Major League Baseball rules, official championship merchandise is not supposed to be seen by the public until the team wins and the players debut the design in their champagne-soaked locker room.

[‘I’m very afraid’: Nats fans filled with dread, joy as playoffs test them again]

But the Nationals want to sell the items as soon as they are allowed, so they preordered the first batch of official We Won! gear to be on standby. (Based on shirts already seen in Toronto and Cleveland locker room, the actual design will read “Respect Washington.”) If the Nats had won Tuesday night, clinching the series, the gear would have gone on sale Wednesday at the team’s stores.

The Post's Jorge Castillo and Chelsea Janes preview the NLDS between the Nationals and Dodgers. (Jayne Orenstein/The Washington Post)

But they lost, and the teams will meet Thursday for a tiebreaking Game 5. If the Nats win that one, managers want the gear ready to sell to happy fans even as they are streaming out of the stadium.

So the screen presses ran overnight Tuesday, and the cartons of gear will be sped to Nationals Park and then shrink-wrapped in plastic and stashed in a padlocked cage with a camera trained on the door, ready for Thursday night’s result.

Only top executives and the team’s head of security can get at the boxes. Anyone in the chain of custody who lets a cap or shirt leak prematurely is subject to penalties from the MLB.

“I don’t even have a key to that lock,” said Mike Carney, the Nationals official in charge of retail.

The caps and shirts that players put on — if they win — are handled by an equally secure supply that goes right into the hands of clubhouse attendants. In September, as the Nationals got close to securing the best record in their division, the team traveled with a stash of carefully guarded “Made for October 2016 Eastern Division Champions” shirts to their last away games in Miami and then Pittsburgh.

They finally got to bust them out — and soak them in bubbly — after defeating the Pirates on Sept. 24. The next morning, clerks at the team store at Nationals Park, and at retailers around the region, put the same licensed merchandise out for sale to the public.

Major League Baseball “wants the locker room celebration to be the big reveal of what the postseason gear looks like,” said Valerie Camillo, the team’s chief revenue and marketing officer. “They are very cautious in having it leak out before the clinch party.”

The Nationals got a scare earlier in the season when just such a leak occurred. A few days before the Nats actually won the division, Camillo and Carney were in a meeting when a picture of the still-embargoed cap popped up on their Twitter feeds. “Our hearts stopped,” Camillo said.

They quickly determined that the picture was shot at a retail shop, not one of the team’s stadium stores. They reported it to MLB officials, who investigated and had the offending merchandise removed. Typically, retailers who let a product slip are limited in the amount of inventory they can sell in the future, a league official said.

“You could just have a junior clerk in the store room saying ‘Oh, isn’t this cool; let me take a picture and put it on social media,’ ” Camillo said. “With thousands of people working at the park on game days, we’re very careful.”

Neither the Nationals nor the MLB would release retail revenue figures, but making the playoffs obviously generates a lot of Visa card swiping. “A postseason game will generate twice the sales of a typical midsummer weekend game,” Carney said.

The Nationals’ front office is one of only six teams in the major leagues that run their own stadium retail operations. This allows the team to produce merchandise based on real-time events. In May, when Max Scherzer tied the major league record of 20 strikeouts in a game, Camillo’s ears perked up when the pitcher said in a postgame interview: “Strikeouts are sexy.”

“Social media blew up with that,” she said. “I called Mike and said, ‘How fast can we get a T-shirt in the store that says ‘Strikeouts are sexy’?” By the next home game, 36 hours later, they were on the racks at $30 each.

“It was our best performing T-shirt of the entire season,” Carney said.

But those “fashion pieces” are far less complicated than the official MLB-licensed products. Knowing how and when to order those is a predictive challenge worthy of Money Ball analysis. Managers want to have the merchandise ready to meet the immediate fan demand. But they don’t want to buy a lot of inventory that will end up worthless if the Nats don’t win the series.

“We try to balance our optimism with our realism,” Camillo said.

The retail team used data science to create a decision tree that factors in probabilities and the schedule to determine when the time was right. For this best-of-five series, the calculus suggested pulling the trigger on Tuesday. That way, the gear would be ready either when the triumphant Nats returned to town or for the decisive Game 5.

But what happens to the caps and shirts if the Nats lose Game 5, and thus the series? Then those pre-made products will enter the nether world of sports marketing known as phantom merchandise.

“I always wonder if there is someone in Africa who is very excited about the Buffalo Bills’ four Super Bowl championships in the 1990s,” said Chris Creamer, referring to the New York team’s bleak string of reaching the big game without winning it.

Creamer runs Toronto-based sportslogo.net, an exhaustive online archive of team logos and championship gear, along with hundreds of phantom logos from would-be champions. Last year’s collection includes designs celebrating the 2015 Clemson Tigers national college football title (they lost to Alabama), the 2015 NBA Champion Cleveland Cavaliers (that would be Golden State) and the Stanley Cup-winning Tampa Bay Lightning (news to the Chicago Blackhawks).

And wistful Nationals fans — who will never forget being eliminated in the first round of the 2012 playoffs — can at least bite a finger over Creamer’s Nats National League Champions T-shirt and, sigh, a World Series cap from that same if-only year.

Creamer won’t sell his images (although collectors do trade in the actual phantom items), and he won’t post them before the championship in question is completed. Some of his images come from his secret sources, and some from fans who send him photographs of actual stuff. “It does get out there,” Creamer said. “I’ve seen a 2003 Chicago Cubs World Series champions shirt hanging on a Salvation Army rack.”