TAIPEI (BLOOMBERG) - Heading into 2019, Tsai Ing-wen looked at risk of becoming Taiwan's first one-term president. Then came the unrest in Hong Kong.
Ms Tsai had clawed back some ground in opinion polls before protesters started taking to the streets of Hong Kong in the hundreds of thousands in June.
But the mass demonstrations there against China's deepening encroachment have given her a noticeable boost ahead of Taiwan's presidential elections in January.
As Taiwanese watch with concern the events in Hong Kong, particularly crackdowns on demonstrators, with scenes of police beating protesters huddled in balls on the floors of Hong Kong's subways, Ms Tsai's firm stance on China has become her biggest selling point.
What happens in Hong Kong, including the way Beijing responds to protracted unrest, matters for democratically run Taiwan, which China considers part of its territory.
The island's leaders have often faced challenges in dealing with China, which is much bigger geographically, economically and militarily. There are risks at home from being seen as either too hard or too soft. And, indeed, it was her China policy that tripped Ms Tsai up in the second half of last year.
Ms Tsai's refusal to endorse Beijing's bottom line that both sides belong to "one China" - sometimes called the 1992 Consensus - while at the same time avoiding overt moves to assert Taiwan's independence upset people on both sides of the spectrum. The upshot was a sense she had mismanaged the China issue.
Still, President Xi Jinping's Jan 2 speech - in which he urged "in-depth democratic consultations" to work towards China's long-held goal of unification and explicitly reaffirmed "one country, two systems" as his preferred model - followed by the protests in Hong Kong have rallied support behind Ms Tsai taking a stronger stance. She has said Taiwan will never unite with China as long as she's in power.
In Taiwan's last presidential election in 2016, Ms Jamie Chiang voted for a candidate who promised a closer relationship with China. Come January, she will back Ms Tsai.
"I am terrified Taiwan may become like Hong Kong if we accept the 92 Consensus," the Taipei electronics company worker said. "I am worried we may lose our democracy, freedom, and everything we are used to because you can't trust China."
Ms Tsai's popularity sank as low as 15 per cent after her Democratic Progressive Party (DPP) fared poorly in local elections in November. Part of her falling approval was due to cuts in civil servant, teacher and military pensions, plus wage stagnation. Ms Tsai stepped down as party chief, and there was chatter she could be dumped as its candidate for the election.
Before the pro-democracy protests erupted in Hong Kong, Ms Tsai still lagged behind challenger Han Kuo-yu of the pro-China opposition Kuomintang by double digits in most opinion polls. Now, she leads Mr Han by eight percentage points, according to a late August survey by broadcaster TVBS. Much of her support is from those under 40.
With an increasingly assertive Chinese leadership under President Xi - and a trade war threatening to split the world into competing spheres of Chinese and US influence - the presidential election is shaping up to be Taiwan's most consequential since its first in 1996.
The DPP favours eventually formalising Taiwan's independent status, thus making unification even harder.
Hong Kong was returned to Chinese rule in 1997 under an agreement with Britain that guaranteed the territory a "high degree of autonomy" until 2047.
Beijing always saw the use of the model in Hong Kong as a test case for Taiwan. The two sides have been ruled separately since Chiang Kai-shek moved his Nationalist government across the Taiwan Strait during the Chinese civil war.
Ms Tsai has been vocal on the turmoil in Hong Kong, speaking at least once a week via Facebook and Twitter in support of the demonstrators. She was the first leader to express concern over the arrests of prominent Hong Kong opposition figures. In a Facebook post in August, she vowed Taiwan would never become like Hong Kong as long as she's president. And last week one of Hong Kong's most well known pro-democracy activists, Mr Joshua Wong, visited Taiwan and met the DPP chairman.
Ms Chiang, the Taipei resident, says she has mostly voted for KMT candidates in previous presidential elections, eager to maintain a harmonious cross-strait relationship since her father works in China and her sister-in-law is from the eastern Chinese province of Zhejiang. That changed with Hong Kong's forceful response to the protests and what she sees as China's willingness to violate international agreements.
"I don't believe anything they say about 'one country, two systems'," she said.
Concern in Taiwan over China's response to the Hong Kong protest movement is showing up in its ubiquitous bubble tea shops. Some Taiwanese chains with mainland branches bowed to online pressure and voiced support for the view that Hong Kong and Taiwan are both part of China.
Back in Taiwan, there have been counter campaigns to buy tea only from outlets that support the demonstrations.
China has used its economic leverage at times of political tension with a number of neighbours, and Taiwan is no exception.
Since Ms Tsai came to power Beijing has curbed the number of mainland tour groups allowed to visit and banned individual tourist travel entirely. Around 40 per cent of Taiwan's exports go to China and about 400,000 Taiwanese work there.
While the protests have given Ms Tsai a boost, other factors have helped, especially among younger voters, such as Taiwan's economic resilience in the face of the US-China trade war and a landmark decision to legalise same-sex marriage in May.
A Taiwan Mainland Affairs Council poll at the end of July showed the number of Taiwanese who support formal independence, either immediately or at a later date, rose to 26 per cent - more than double those who want unification.
It also showed that almost 90 per cent of respondents opposed "one country, two systems", and about 65 per cent supported protests in Hong Kong.
The hand of China has played out ahead of previous elections. The People's Liberation Army conducted missile tests in the Taiwan Strait in 1996 in an unsuccessful effort to scare voters against voting for then-President Lee Teng-hui.
Shortly before the 2016 poll, Chinese Internet users pressured a 16-year-old Taiwanese member of a South Korean pop band into recording a video apologising for appearing on a Korean TV show holding Taiwan's flag.
Ms Tsai's victory is by no means assured, as two other high-profile figures continue to hint at presidential runs. Taipei city mayor Ko Wen-je, and the billionaire founder of iPhone assembler Foxconn, Mr Terry Gou, have until mid-September to decide whether to run.
KMT challenger Han favours closer exchanges with China, but has been quiet about specific cross-strait policies since he won the party nomination. He plans to give a detailed account of his stance by the end-September, says political adviser Chao Chien-min.
Mr Chao stresses that Mr Han disagrees with "one country, two systems". Mr Han had previously described Taiwan and China as two partners in an "arranged marriage" who had fallen "madly in love", and said peace talks between the two were inevitable.
He became the first elected official from Taiwan to visit Beijing's liaison office - the Communist Party's outpost in Hong Kong - during a trip there in March.
For Ms Tsai, much may depend on how the Hong Kong protests play out.
"Even though Hong Kong's protest has a decisive effect among the young generation in Taiwan in helping them form their political preferences for the first time, its effect among the older generation depends on how much the protest and the trade war influence China's economy," said Mr Austin Wang, an assistant professor of political science at the University of Nevada. "It's too early to say who will win in the end."