| Commitments and Contingencies (Tables)
 | 9 Months Ended | 
| Sep. 30, 2018 | 
|---|
| Commitments and Contingencies Disclosure [Abstract] |  | 
| Future Minimum Payments Under Operating Leases | 
As of September 30, 2018, future minimum rental income under non-cancelable subleases is as follows:
 
|  |  
|  |  |  |  |  
|   | Amount |  
|   | (in thousands) |  
| 2018 (3 months) | $ | 680 | 
 |  
| 2019 | 3,566 | 
 |  
| 2020 | 4,036 | 
 |  
| 2021 | 4,057 | 
 |  
| 2022 | 782 | 
 |  
| Thereafter | 291 | 
 |  
| Total minimum rental income | $ | 13,412 | 
 |  
As of September 30, 2018, future minimum payments under non-cancelable operating leases, inventory purchase and other obligations are as follows:
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Operating Leases |   | Inventory Purchase Obligations |   | Other Obligations |   | Total |  
|   | (in thousands) |  
| 2018 (3 months) | $ | 2,288 | 
 |   | $ | 38,462 | 
 |   | $ | 1,875 | 
 |   | $ | 42,625 | 
 |  
| 2019 | 8,792 | 
 |   | — | 
 |   | 8,379 | 
 |   | 17,171 | 
 |  
| 2020 | 8,989 | 
 |   | — | 
 |   | 4,417 | 
 |   | 13,406 | 
 |  
| 2021 | 8,776 | 
 |   | — | 
 |   | 686 | 
 |   | 9,462 | 
 |  
| 2022 | 4,173 | 
 |   | — | 
 |   | 425 | 
 |   | 4,598 | 
 |  
| Thereafter | 798 | 
 |   | — | 
 |   | 447 | 
 |   | 1,245 | 
 |  
| Total minimum payments | $ | 33,816 | 
 |   | $ | 38,462 | 
 |   | $ | 16,229 | 
 |   | $ | 88,507 | 
 |  | 
| Future Minimum Payments Under Other Obligations | 
As of September 30, 2018, future minimum payments under non-cancelable operating leases, inventory purchase and other obligations are as follows:
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Operating Leases |   | Inventory Purchase Obligations |   | Other Obligations |   | Total |  
|   | (in thousands) |  
| 2018 (3 months) | $ | 2,288 | 
 |   | $ | 38,462 | 
 |   | $ | 1,875 | 
 |   | $ | 42,625 | 
 |  
| 2019 | 8,792 | 
 |   | — | 
 |   | 8,379 | 
 |   | 17,171 | 
 |  
| 2020 | 8,989 | 
 |   | — | 
 |   | 4,417 | 
 |   | 13,406 | 
 |  
| 2021 | 8,776 | 
 |   | — | 
 |   | 686 | 
 |   | 9,462 | 
 |  
| 2022 | 4,173 | 
 |   | — | 
 |   | 425 | 
 |   | 4,598 | 
 |  
| Thereafter | 798 | 
 |   | — | 
 |   | 447 | 
 |   | 1,245 | 
 |  
| Total minimum payments | $ | 33,816 | 
 |   | $ | 38,462 | 
 |   | $ | 16,229 | 
 |   | $ | 88,507 | 
 |  | 
| Future Minimum Payments Under Inventory Purchase Obligations | 
As of September 30, 2018, future minimum payments under non-cancelable operating leases, inventory purchase and other obligations are as follows:
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Operating Leases |   | Inventory Purchase Obligations |   | Other Obligations |   | Total |  
|   | (in thousands) |  
| 2018 (3 months) | $ | 2,288 | 
 |   | $ | 38,462 | 
 |   | $ | 1,875 | 
 |   | $ | 42,625 | 
 |  
| 2019 | 8,792 | 
 |   | — | 
 |   | 8,379 | 
 |   | 17,171 | 
 |  
| 2020 | 8,989 | 
 |   | — | 
 |   | 4,417 | 
 |   | 13,406 | 
 |  
| 2021 | 8,776 | 
 |   | — | 
 |   | 686 | 
 |   | 9,462 | 
 |  
| 2022 | 4,173 | 
 |   | — | 
 |   | 425 | 
 |   | 4,598 | 
 |  
| Thereafter | 798 | 
 |   | — | 
 |   | 447 | 
 |   | 1,245 | 
 |  
| Total minimum payments | $ | 33,816 | 
 |   | $ | 38,462 | 
 |   | $ | 16,229 | 
 |   | $ | 88,507 | 
 |  |