Long Term Debt - Narrative (Details) | Dec. 31, 2020USD ($)$ / sharesshares | Apr. 21, 2020USD ($) | Jun. 12, 2019USD ($)$ / sharesshares | Jun. 30, 2021USD ($)$ / shares | Jun. 12, 2019USD ($)$ / shares | Jun. 30, 2021USD ($)$ / shares | Mar. 31, 2021USD ($) | Dec. 31, 2020USD ($)$ / shares | Jun. 30, 2020USD ($) | Jun. 30, 2021USD ($)$ / sharesshares | Jun. 30, 2020USD ($) | Dec. 31, 2017$ / shares | Dec. 31, 2020USD ($)$ / shares | Dec. 31, 2020USD ($)$ / shares | Dec. 31, 2017$ / shares | Dec. 31, 2020USD ($)$ / sharesshares | Dec. 31, 2019USD ($)$ / sharesshares | Dec. 31, 2017USD ($)$ / sharesshares | May 25, 2021 | Oct. 20, 2020USD ($)$ / shares | Sep. 29, 2020USD ($) | Mar. 09, 2020USD ($) | Feb. 19, 2020USD ($)$ / shares | Mar. 31, 2019USD ($) | Mar. 27, 2019USD ($) | Mar. 05, 2019USD ($) | May 26, 2017USD ($) | Jan. 27, 2017USD ($) |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | $ (6,008,000) | | | $ 312,000 | $ (45,661,000) | $ (2,222,000) | | | | | $ (20,163,000) | $ (2,969,000) | | | | | | | | | | | |
Long-term debt | $ 54,641,000 | | | $ 128,504,000 | | $ 128,504,000 | | $ 54,641,000 | | $ 128,504,000 | | | $ 54,641,000 | $ 54,641,000 | | $ 54,641,000 | | | | | | | | | | | | |
Warrants issued (in shares) | shares | | | | | | | | | | 18,694 | | | | | | 51,859 | 304,864 | | | | | | | | | | | |
Warrants outstanding, exercise price (in dollars per share) | $ / shares | $ 0.01 | | | $ 0.01 | | $ 0.01 | | $ 0.01 | | $ 0.01 | | | $ 0.01 | $ 0.01 | | $ 0.01 | $ 0.01 | | | | | | | | | | | |
Forgiveness of Paycheck Protection Program loan | | | | $ 2,900,000 | | $ 2,860,000 | | | | $ 2,860,000 | 0 | | | | | | | | | | | | | | | | | |
Class of warrants or rights exercise price | $ / shares | $ 0.01 | | | $ 0.01 | | $ 0.01 | | $ 0.01 | | $ 0.01 | | | $ 0.01 | $ 0.01 | | $ 0.01 | $ 0.01 | | | | | | | | | | | |
Proceeds from the issuance of common stock | | | | | | | | | | | 1,961,000 | | | | | $ 1,961,000 | $ 38,639,000 | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | $ (6,008,000) | | | $ 312,000 | $ (45,661,000) | $ (2,222,000) | | | | | (20,163,000) | $ (2,969,000) | | | | | | | | | | | |
Long term debt net of current portion | $ 54,641,000 | | | $ 128,504,000 | | $ 128,504,000 | | $ 54,641,000 | | $ 128,504,000 | | | $ 54,641,000 | $ 54,641,000 | | $ 54,641,000 | | | | | | | | | | | | |
3.00% – 2020 Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | 3.00% | | | | | | | 3.00% | | | | | 3.00% | 3.00% | | 3.00% | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | | | | | | | | | $ 10,825,000 | | | | | | | | | | | | | | |
Long-term debt | $ 21,281,000 | | | | | | | $ 21,281,000 | | | | | $ 21,281,000 | 21,281,000 | | $ 21,281,000 | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | | | | | | | | | 10,825,000 | | | | | | | | | | | | | | |
8.00% – 2020 Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | | | | | | | | 4,374,000 | | | | | | | | | | | | | | | |
Long-term debt | 8,000,000 | | | | | | | 8,000,000 | | | | | 8,000,000 | 8,000,000 | | 8,000,000 | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | | | | | | | | 4,374,000 | | | | | | | | | | | | | | | |
5.00% – $30.0 Million Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | | | | 5.00% | | 5.00% | | | | 5.00% | | | | | | | | | | | | | | | | | | |
Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Long term debt net of current portion | $ 76,281,000 | | | $ 164,453,000 | | $ 164,453,000 | | $ 76,281,000 | | $ 164,453,000 | | | $ 76,281,000 | $ 76,281,000 | | $ 76,281,000 | | | | | | | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | 3.00% | | | 3.00% | | 3.00% | | 3.00% | 3.00% | 3.00% | 3.00% | | 3.00% | 3.00% | | 3.00% | | | 3.00% | | | 3.00% | | | | | | |
Unpaid interest | | | | | | $ 100,000 | | | | $ 300,000 | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | 1,100,000 | | | | 4,108,000 | | | | | | $ 10,800,000 | | | | | | | | | | | | |
Long-term debt | $ 21,281,000 | | | $ 21,281,000 | | 21,281,000 | | $ 21,281,000 | | 21,281,000 | | | $ 21,281,000 | $ 21,281,000 | | 21,281,000 | | | | | | | | | | | | |
Debt instrument, principal amount | 21,300,000 | | | 21,300,000 | | 21,300,000 | | 21,300,000 | | 21,300,000 | | | 21,300,000 | 21,300,000 | | 21,300,000 | | | | | | $ 21,300,000 | | | | | | |
Long term debt term | | | | | | | | | | | | | | | | | | | | | | 5 years | | | | | | |
Debt instrument face value | $ 21,300,000 | | | $ 21,300,000 | | 21,300,000 | | $ 21,300,000 | | 21,300,000 | | | $ 21,300,000 | $ 21,300,000 | | 21,300,000 | | | | | | $ 21,300,000 | | | | | | |
Proceeds from the issuance of common stock | | | | | | | | | | | | | | | | 300,000 | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | $ 1,100,000 | | | | $ 4,108,000 | | | | | | 10,800,000 | | | | | | | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | Prospective Equity Financing [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Proceeds from the issuance of common stock | | | | | | | | | | | | | | | | $ 10,000,000 | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | | | | $ 14.298 | | | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | Prospective Exit Event [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | | | | 14.298 | | | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | Maturity [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | | | | 14.298 | | | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | If Equity Financing Is Not Raised [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | | | | $ 14.298 | | | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | Tranche One [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | 20,000,000 | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | $ 20,000,000 | | | | | | |
Convertible Notes | 3.00% – 2020 Convertible Notes | Tranche Two [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | $ 1,300,000 | | | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | $ 1,300,000 | | | | | | | | |
Convertible Notes | 8.00% – 2020 Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | 8.00% | | | 8.00% | | 8.00% | | 8.00% | | 8.00% | | | 8.00% | 8.00% | | 8.00% | | | | | | | 8.00% | | | | | |
Unpaid interest | | | | | | $ 200,000 | | | $ 100,000 | $ 300,000 | $ 200,000 | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | 500,000 | | | | 2,249,000 | | | | | | $ 6,800,000 | | | | | | | | | | | | |
Long-term debt | $ 8,000,000 | | | $ 8,000,000 | | 8,000,000 | | $ 8,000,000 | | 8,000,000 | | | $ 8,000,000 | $ 8,000,000 | | 8,000,000 | | | | | | | | | | | | |
Debt instrument, principal amount | 8,000,000 | | | 8,000,000 | | 8,000,000 | | 8,000,000 | | 8,000,000 | | | 8,000,000 | 8,000,000 | | 8,000,000 | | | | | | | $ 8,000,000 | | | | | |
Long term debt term | | | | | | | | | | | | | | | | | | | | | | | 7 years | | | | | |
Debt instrument face value | $ 8,000,000 | | | $ 8,000,000 | | 8,000,000 | | 8,000,000 | | 8,000,000 | | | 8,000,000 | 8,000,000 | | 8,000,000 | | | | | | | $ 8,000,000 | | | | | |
Proceeds from the issuance of common stock | | | | | | | | | | | | | | | | 600,000 | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | $ 500,000 | | | | $ 2,249,000 | | | | | | 6,800,000 | | | | | | | | | | | | |
Convertible Notes | 8.00% – 2020 Convertible Notes | Investor Warrants Exercisable Into Common Stock [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Warrants outstanding, exercise price (in dollars per share) | $ / shares | | | | | | | | | | | | | | | | | | | | | | | $ 0.00001 | | | | | |
Class of warrants or rights exercise price | $ / shares | | | | | | | | | | | | | | | | | | | | | | | 0.00001 | | | | | |
Convertible Notes | 8.00% – 2020 Convertible Notes | Prospective Equity Financing [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | | | | | | | $ 14.298 | | | | | |
Convertible Notes | 8.00% – 2020 Convertible Notes | Prospective Exit Event [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, conversion price, discount | | | | | | | | | | | | | | | | | | | | | | | 25.00% | | | | | |
Shares issued price per share | $ / shares | | | | | | | | | | | | | | | | | | | | | | | $ 14.298 | | | | | |
Convertible Notes | 8.00% – 2020 Convertible Notes | Maturity [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | | | | | | | $ 14.298 | | | | | |
Convertible Notes | 5.00% – $50.0 Million Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | | | | 5.00% | | 5.00% | | | | 5.00% | | | | | | | | | | | | | | | | | | |
Unpaid interest | | | | | | $ 100,000 | | | | $ 300,000 | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | 300,000 | | | | 946,000 | | | | | | | | | | | | | | | | | | |
Long-term debt | | | | $ 10,274,000 | | 10,274,000 | | | | 10,274,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | 50,000,000 | | 50,000,000 | | | | 50,000,000 | | | | | | | | | | | | | | | | | | |
Proceeds from equity triggering debt conversion, minimum, amount | | | | $ 25,000,000 | | $ 25,000,000 | | | | $ 25,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, conversion price, discount | | | | 15.00% | | 15.00% | | | | 15.00% | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, denominator used to calculate conversion price, amount | | | | $ 1,500,000,000 | | $ 1,500,000,000 | | | | $ 1,500,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument face value | | | | $ 50,000,000 | | 50,000,000 | | | | 50,000,000 | | | | | | | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | $ 300,000 | | | | $ 946,000 | | | | | | | | | | | | | | | | | | |
Convertible Notes | 5.00% – $25.0 Million Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | | | | 5.00% | | 5.00% | | | | 5.00% | | | | | | | | | | | | | | | | | | |
Unpaid interest | | | | | | $ 300,000 | | | | $ 600,000 | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | 1,300,000 | | | | 5,478,000 | | | | | | | | | | | | | | | | | | |
Long-term debt | | | | $ 25,000,000 | | 25,000,000 | | | | 25,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | 25,000,000 | | 25,000,000 | | | | 25,000,000 | | | | | | | | | | | | | | | | | | |
Proceeds from equity triggering debt conversion, minimum, amount | | | | $ 25,000,000 | | $ 25,000,000 | | | | $ 25,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, conversion price, discount | | | | 25.00% | | 25.00% | | | | 25.00% | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, denominator used to calculate conversion price, amount | | | | $ 800,000,000 | | $ 800,000,000 | | | | $ 800,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, denominator used to calculate conversion price at maturity date, amount | | | | $ 675,000,000 | | $ 675,000,000 | | | | $ 675,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, conversion price | | | | | | | | | | 100.00% | | | | | | | | | | | | | | | | | | |
Warrants issued (in shares) | shares | 278,775 | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Warrants outstanding, stated rate | | | | 5.00% | | 5.00% | | | | 5.00% | | | | | | | | | | | | | | | | | | |
Warrants outstanding, exercise price (in dollars per share) | $ / shares | | | | $ 0.00001 | | $ 0.00001 | | | | $ 0.00001 | | | | | | | | | | | | | | | | | | |
Debt instrument face value | | | | $ 25,000,000 | | $ 25,000,000 | | | | $ 25,000,000 | | | | | | | | | | | | | | | | | | |
Class of warrants or rights exercise price | $ / shares | | | | $ 0.00001 | | $ 0.00001 | | | | $ 0.00001 | | | | | | | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | $ 1,300,000 | | | | $ 5,478,000 | | | | | | | | | | | | | | | | | | |
Convertible Notes | 5.00% – $30.0 Million Convertible Notes | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, stated percentage | | | | 5.00% | | 5.00% | | | | 5.00% | | | | | | | | | | | | | | | | | | |
Unpaid interest | | | | | | $ 400,000 | | | | $ 700,000 | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | 1,400,000 | | | | 8,413,000 | | | | | | | | | | | | | | | | | | |
Long-term debt | | | | $ 30,000,000 | | 30,000,000 | | | | 30,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | 30,000,000 | | 30,000,000 | | | | 30,000,000 | | | | | | | | | | | | | | | | | | |
Proceeds from equity triggering debt conversion, minimum, amount | | | | $ 25,000,000 | | $ 25,000,000 | | | | $ 25,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, conversion price, discount | | | | 25.00% | | 25.00% | | | | 25.00% | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, denominator used to calculate conversion price, amount | | | | $ 800,000,000 | | $ 800,000,000 | | | | $ 800,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, denominator used to calculate conversion price at maturity date, amount | | | | 800,000,000 | | 800,000,000 | | | | 800,000,000 | | | | | | | | | | | | | | | | | | |
Debt instrument face value | | | | 30,000,000 | | 30,000,000 | | | | 30,000,000 | | | | | | | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | 1,400,000 | | | | 8,413,000 | | | | | | | | | | | | | | | | | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | $ 15,000,000 | | | | |
Long term debt term | | | | | | | | | | | | | | | | | 2 years | | | | | | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | $ 15,000,000 | | | | |
Long term debt fixed rate percentage | | | | | | | | | | | | | | | | | 8.00% | | | | | | | | | | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | Equity Financing [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Proceeds from the issuance of common stock | | | $ 24,000,000 | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | $ 11.44 | | $ 11.44 | | | | | | | | | | | | | | | | | | | | | | | |
Interest Expense, Debt, Excluding Amortization | | | | | $ 300,000 | | | | | | | | | | | | $ 15,000,000 | | | | | | | | | | | |
Debt Conversion, Converted Instrument, Shares Issued | shares | | | 1,336,344 | | | | | | | | | | | | | | | | | | | | | | | | | |
Gain (Loss) on Extinguishment of Debt | | | | | | | | | | | | | | | | | $ 3,000,000 | | | | | | | | | | | |
Share Price | $ / shares | | | $ 13.65 | | $ 13.65 | | | | | | | | | | | | | | | | | | | | | | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | Forecast [Member] | Prospective Equity Financing [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, convertible, conversion price, discount | | | | | | | | | | | | | | | | | 20.00% | | | | | | | | | | | |
Proceeds from the issuance of common stock | | | | | | | | | | | | | | | | | $ 10,000,000 | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | $ 11.4384 | | | | | | | | | | | |
Shares issued price per share | $ / shares | | | | | | | | | | | | | | | | | 14.298 | | | | | | | | | | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | Forecast [Member] | Prospective Exit Event [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | 14.298 | | | | | | | | | | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | Forecast [Member] | Maturity [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument conversion price price per share | $ / shares | | | | | | | | | | | | | | | | | $ 14.298 | | | | | | | | | | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | Tranche One [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | | | $ 6,700,000 | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | | | $ 6,700,000 | | |
Convertible Notes | Two Thousand And Nineteen Convertible Notes [Member] | Tranche Two [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | | $ 8,300,000 | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | | $ 8,300,000 | | | |
2020 Term Facility Loan | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | 1,200,000 | | 1,729,000 | | 14,921,000 | | | | | | 1,700,000 | | | | | | | | | | | | |
Interest paid | | | | | | 200,000 | | | | 300,000 | | | | | | | | | | | | | | | | | | |
Long-term debt | $ 22,500,000 | | | 33,949,000 | | 33,949,000 | | 22,500,000 | | 33,949,000 | | | 22,500,000 | 22,500,000 | | 22,500,000 | | | | | | | | | | | | |
Debt instrument, portion to be converted to equity | | | | | | | | | | | | | | | | | | | 30.00% | | | | | | | | | |
Debt instrument, portion to be repaid | | | | | | | | | | | | | | | | | | | 70.00% | | | | | | | | | |
Debt instrument, principal amount | 35,000,000 | | | 35,000,000 | | 35,000,000 | | 35,000,000 | | 35,000,000 | | | 35,000,000 | 35,000,000 | | 35,000,000 | | | | | | | | | | | | |
Debt instrument face value | 35,000,000 | | | $ 35,000,000 | | 35,000,000 | | 35,000,000 | | 35,000,000 | | | 35,000,000 | 35,000,000 | | 35,000,000 | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | $ 1,200,000 | | 1,729,000 | | 14,921,000 | | | | | | 1,700,000 | | | | | | | | | | | | |
2020 Term Facility Loan | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | | $ 1,200,000 | | | 14,900,000 | | | | | | | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | | $ 1,200,000 | | | $ 14,900,000 | | | | | | | | | | | | | | | | | | |
January Two Thousand And Seventeen Term Loan [Member] | Silicon Valley Bank [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ 5,000,000 |
Warrants outstanding, exercise price (in dollars per share) | $ / shares | | | | | | | | | | | | $ 8.646 | | | $ 8.646 | | | $ 8.646 | | | | | | | | | | |
Long term debt date of maturity | | | | | | | | | | | | Mar. 31, 2020 | | | Mar. 31, 2020 | | | Mar. 31, 2020 | | | | | | | | | | |
Long term debt term | | | | | | | | | | | | 36 months | | | 36 months | | | 36 months | | | | | | | | | | |
Long term debt floor rate | | | | | | | | | | | | 9.00% | | | 9.00% | | | 9.00% | | | | | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ 5,000,000 |
Class of warrants or rights warrants issued during the period units | shares | | | | | | | | | | | | | | | | | | 52,050 | | | | | | | | | | |
Class of warrants or rights exercise price | $ / shares | | | | | | | | | | | | $ 8.646 | | | $ 8.646 | | | $ 8.646 | | | | | | | | | | |
Class of warrants or rights maturity date | | | | | | | | | | | | Jan. 27, 2027 | | | Jan. 27, 2027 | | | Jan. 27, 2027 | | | | | | | | | | |
January Two Thousand And Seventeen Term Loan [Member] | Prime Rate [Member] | Silicon Valley Bank [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument variable interest rate spread | | | | | | | | | | | | | | | 5.50% | | | | | | | | | | | | | |
May Two Thousand And Seventeen Term Loan [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | | | | $ 10,000,000 | |
Long term debt term | | | | | | | | | | | | 36 months | | | 36 months | | | 36 months | | | | | | | | | | |
Debt instrument variable interest rate spread | | | | | | | | | | | | 5.50% | | | | | | | | | | | | | | | | |
Long term debt floor rate | | | | | | | | | | | | 9.00% | | | 9.00% | | | 9.00% | | | | | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | | | | 10,000,000 | |
Long term debt variable interest rate percentage | | | | | | | | | | | | | | | | | 11.00% | | | | | | | | | | | |
Proceeds from long term bank loan | | | | | | | | | | | | | | | | | | $ 5,000,000 | | | | | | | | | | |
May Two Thousand And Seventeen Term Loan [Member] | Silicon Valley Bank [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | | | | 5,000,000 | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | | | | 5,000,000 | |
May Two Thousand And Seventeen Term Loan [Member] | Kreos Capital [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | | | | | | | 4,500,000 | |
Warrants outstanding, exercise price (in dollars per share) | $ / shares | | | | | | | | | | | | $ 8.646 | | | $ 8.646 | | | $ 8.646 | | | | | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | | | | | | | $ 4,500,000 | |
Class of warrants or rights warrants issued during the period units | shares | | | | | | | | | | | | | | | | | | 52,050 | | | | | | | | | | |
Class of warrants or rights exercise price | $ / shares | | | | | | | | | | | | $ 8.646 | | | $ 8.646 | | | $ 8.646 | | | | | | | | | | |
Class of warrants or rights maturity date | | | | | | | | | | | | May 26, 2027 | | | May 26, 2027 | | | May 26, 2027 | | | | | | | | | | |
Term Loan [Member] | Two Thousand And Nineteen Convertible Notes [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Gain (loss) on debt instrument | | | | | | | | | | | | | | | | 2,500,000 | | | | | | | | | | | | |
Interest paid | | | | | | | | | | | | | | | | 2 | | | | | | | | | | | | |
Long-term debt | $ 22,500,000 | | | | | | | $ 22,500,000 | | | | | $ 22,500,000 | $ 22,500,000 | | $ 22,500,000 | | | | | | | | | | | | |
Debt instrument, principal amount | | | | | | | | | | | | | | | | | | | | | $ 35,000,000 | | | | | | | |
Debt instrument face value | | | | | | | | | | | | | | | | | | | | | $ 35,000,000 | | | | | | | |
Long term debt fixed rate percentage | 0.10% | | | | | | | 0.10% | | | | | 0.10% | 0.10% | | 0.10% | | | | | | | | | | | | |
Fair value measurements with unobservable inputs reconciliation recurring basis liability gain loss included in earnings | | | | | | | | | | | | | | | | $ 2,500,000 | | | | | | | | | | | | |
Term Loan [Member] | Two Thousand And Nineteen Convertible Notes [Member] | Prospective Qualified Exit [Member] | Minimum [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Public float | $ 350,000,000 | | | | | | | $ 350,000,000 | | | | | $ 350,000,000 | $ 350,000,000 | | 350,000,000 | | | | | | | | | | | | |
Paycheck Protection Program, CARES Act [Member] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Debt Instrument [Line Items] | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Long-term debt | $ 2,860,000 | | | | | | | $ 2,860,000 | | | | | $ 2,860,000 | $ 2,860,000 | | $ 2,860,000 | | | | | | | | | | | | |
Long term debt term | 24 months | | | | | | | 24 months | | | | | 24 months | 24 months | | 24 months | | | | | | | | | | | | |
Proceeds from long term bank loan | | $ 2,900,000 | | | | | | | | | | | | | | | | | | | | | | | | | | |
Long term debt fixed rate percentage | 1.00% | | | | | | | 1.00% | | | | | 1.00% | 1.00% | | 1.00% | | | | | | | | | | | | |
Number of times the payroll expenses for which the loan may be borrowed | | 2.5 | | | | | | | | | | | | | | | | | | | | | | | | | | |
Long term debt net of current portion | $ 2,900,000 | | | | | | | $ 2,900,000 | | | | | $ 2,900,000 | $ 2,900,000 | | $ 2,900,000 | | | | | | | | | | | | |