| Other expense, net (Details) - USD ($) $ in Thousands | 3 Months Ended | 9 Months Ended | ||
|---|---|---|---|---|
| Sep. 30, 2019 | Sep. 30, 2018 | Sep. 30, 2019 | Sep. 30, 2018 | |
| Other expense, net | ||||
| Foreign exchange losses | $ 235 | $ (2,185) | $ (778) | $ (7,790) | 
| Gains on redemption or maturity of available-for-sale debt securities | 13 | |||
| Losses on redemption or maturity of available-for-sale debt securities | (2,473) | |||
| Other | 56 | (64) | 209 | (262) | 
| Other income, net | $ 291 | $ (2,249) | $ (556) | $ (10,525) | 
| X | ||||||||||
| 
- Definition Amount of other income (expense) related to nonoperating activities, classified as other. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of realized gain on investment in debt security measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale). Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount of realized loss on investment in debt security measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale). Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount before tax of foreign currency transaction realized and unrealized gain (loss) recognized in the income statement. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount of income (expense) related to nonoperating activities, classified as other. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 |