CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE (LOSS) INCOME (unaudited) (Parenthetical) - USD ($) $ in Thousands  | 
3 Months Ended | 9 Months Ended | ||
|---|---|---|---|---|
Sep. 30, 2023  | 
Sep. 30, 2022  | 
Sep. 30, 2023  | 
Sep. 30, 2022  | 
|
| Foreign currency translation adjustment, tax | $ 0 | $ (215) | $ 0 | $ (215) | 
| Products | ||||
| Cost of revenue, depreciation, depletion, amortization and accretion | 2,836 | 2,863 | 6,395 | 6,711 | 
| Nonrelated Party | Services | ||||
| Cost of revenue, depreciation, depletion, amortization and accretion | $ 8,394 | $ 12,968 | $ 30,426 | $ 43,727 | 
| X | ||||||||||
- Definition Amount of expense for allocation of cost of tangible and intangible assets over their useful lives directly used in production of good and rendering of service. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
  | 
| X | ||||||||||
- Definition Amount of tax expense (benefit), after reclassification adjustments of gain (loss) on foreign currency translation adjustments, foreign currency transactions designated and effective as economic hedges of a net investment in a foreign entity and intra-entity foreign currency transactions that are of a long-term-investment nature, attributable to parent entity. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
  | 
| X | ||||||||||
- Details 
  | 
| X | ||||||||||
- Details 
  | 
| X | ||||||||||
- Details 
  |