You’ve read post-election analysis by the discredited corporate pundits who thought Hillary Clinton was a shoo-in. Since I saw Donald Trump’s “upset” coming, my take on what happened and why may be of more interest.

As with any large-scale disaster, the ascent of a spectacularly unqualified buffoon to the most powerful political office on Earth came about as the result of numerous system failures and operator errors. Here’s a bird’s-eye view of what went wrong.

System Failures

1. Democrats took their progressive base for granted.

Following George McGovern’s landslide loss to Richard Nixon in 1972, the Democrats’ conservative southern wing seized control of the Democratic National Committee and other leadership apparatus. Center-right Democrats won four presidential races with Bill Clinton and Barack Obama, but at a cost. Election after election, liberals and progressives — the party’s base and thus its greatest potential source of votes, donations and enthusiasm — were taken for granted as the party moved right in search of swing voters. Where else, the Clintonian Brahmins asked smugly, could lefties go? The answer was nowhere: snubbed, unmotivated and disgusted, they stayed home this November.

2. No safety net for workers displaced by globalization and deindustrialization.

NAFTA wasn’t the beginning; it was the last nail in the coffin of the postwar boom that elevated blue-collar manufacturing jobs to professions paying enough to finance the American Dream. Year after year, millions of workers lost good jobs and were forced to make due with two lousy ones. Inner cities, and not a few suburbs, rotted and died. Neither major party talked about the Making of America Not Great Anymore, much less tried to do anything about it. Trump scored big Rust Belt points merely by acknowledging the long-ignored pain of millions.

3. In media coverage of the horse race, some candidates are more equal than others.

If you were designing American democracy from scratch, you’d probably make it a rule that every candidate for office receives the same attention from the media. (France does this.) But we’re light years away from that ideal. Trump received more TV minutes and column inches than his Republican rivals because he was (a) outrageous and (b) a celebrity. Clinton’s coverage overshadowed Sanders’ because media gatekeepers were (a) enamored of their pre-fab “first woman president follows first black president” narrative and (b) couldn’t imagine that an elderly socialist from Vermont could be a serious contender. Who would be president-elect today had Rand Paul, Carla Fiorina and Sanders been given a fair chance to make their cases to the voters? Probably not Trump.

Operator Errors

4. Hillary’s campaign partied like it was 1996.

Campaigning has changed since the Clintonian heyday of the 1990s, but Hillary’s strategists didn’t get the memo. Trump ad-libbed outrageous video bites at his rallies, making them must-see TV and earning billions in free exposure; Hillary stuck to her deadly dull stump speech, doomed to be ignored.

While Trump worked Twitter like a tween at 3 a.m. — ensuring that story-hungry editors would see his hilarious rants when they arrived at his desk — it took 12 Clinton staffers to compose a single tweet whose made-by-committee provenance made it dead on arrival. She spent many millions on a repeat loop of anti-Trump TV ads featuring clips everyone had already seen.

Considering that she barely survived Sanders’ primary challenge, it should have been obvious to her team that the Democratic Party has moved left (as has the nation). So why did her 2016 campaign follow the old Dick Morris move-right-for-the-general-election model from 1996, moving right in order to “reach out to Republican mega-donors”?

Meanwhile, Morris himself understood the new reality. “But Trump is doing more than driving populist Democrats into Republican arms,” Morris wrote. “He is separating the establishment left of the Democratic Party from its populist base. His candidacy separates the blue-collar social populists from their partisan moorings even as his economic populism appeals to the Sanders left.” He wrote that in May.

5. The DNC ignored polls that showed Bernie was a better candidate than Hillary.

Trump’s “surprise” win wasn’t shocking to people who were paying attention. Throughout the primary and general election, the DNC brushed off head-to-head tracking polls that showed that Clinton never enjoyed a commanding lead over, and sometimes fell behind, Trump. Sanders, on the other hand, consistently held a double-digit lead, sometimes as high as 20 percent, over Trump. As it turned out, Trump would have lost to Sanders.

In a change year when Americans were in the mood for radical populism, Sanders offered all the stuff voters liked about Trump — his anti-free trade message, economic populism, opposition to stupid foreign wars, the fiery, outspoken energy of a loud New Yorker — minus his manic loopiness and offensive comments about women and minorities.

Granted, Bernie’s poll numbers would have suffered under an onslaught of ads depicting the Vermont senator as the second coming of Stalin, Soviet May Day parade footage and “The Internationale” playing incessantly. But the Cold War is over. Americans are more afraid of cost-cutting CEOs than commissars.

6. Clinton didn’t appoint Sanders as vice president, or to a Cabinet position.

Democratic voters wanted Hillary — a lifelong right-wing Democrat — to balance the ticket by choosing a progressive running mate like Elizabeth Warren, Cory Booker or her rival Sanders. But she never considered any of them, going instead with some guy whose name I still struggle to remember. Ironically, no one understood the disastrous implications of Hillary’s choice better than right-wing blogger Wayne Allyn Root in The Blaze: ” Hillary desperately needed a shot in the arm; an exciting and edgy vice president by her side … Tim Kaine isn’t just boring … Kaine is an affront to every Bernie Sanders supporter — which happens to be all the youth and energy in the entire Democrat Party.”

Ted Rall is author of “Trump: A Graphic Biography,” an examination of the life of the Republican president-elect in comics form. © 2016, Ted Rall