Entity information:
INCOME TAXES
The domestic and foreign components of loss before income taxes are as follows (in thousands):
 
Year Ended December 31,
2017
 
2016
 
2015
Domestic
$
(10,900
)
 
$
(145,499
)
 
$
(157,229
)
Foreign
(51,764
)
 
(24,174
)
 
(18,842
)
Loss before income taxes
$
(62,664
)
 
$
(169,673
)
 
$
(176,071
)

        
The components of the provision for income taxes are as follows (in thousands):
 
Year Ended December 31,
2017
 
2016
 
2015
Current:
 
 
 
 
 
Federal
$
(1,192
)
 
$
63

 
$
1,662

State
739

 
527

 
836

Foreign
1,987

 
1,269

 
1,222

Total current provision for income taxes
1,534

 
1,859

 
3,720

Deferred:
 
 
 
 
 
Federal
(1,169
)
 
173

 
67

State
57

 
18

 
11

Foreign
(273
)
 
(133
)
 
(52
)
Total deferred provision for income taxes
(1,385
)
 
58

 
26

Total provision for income taxes
$
149

 
$
1,917

 
$
3,746


The following is a reconciliation of the statutory federal income tax rate to the Company's effective tax rate:
 
Balance at December 31,
2017
 
2016
 
2015
Tax at federal statutory rate
34.0
 %
 
34.0
 %
 
34.0
 %
State taxes, net of federal benefit
(0.4
)
 
(0.1
)
 
(0.2
)
Foreign rate differential
(14.9
)
 
(2.4
)
 
(1.8
)
Nondeductible expenses
(1.0
)
 
(0.9
)
 
(1.1
)
Credits
41.5

 
8.5

 
8.2

Other items
(1.2
)
 
0.2

 
0.1

Change in valuation allowance
(119.5
)
 
(37.4
)
 
(38.6
)
Impact of U.S. tax reform
(209.1
)
 

 

Share-based compensation (i)
243.5

 
(2.4
)
 
(2.2
)
Change in uncertain tax positions
(2.4
)
 
(0.6
)
 
(0.5
)
Termination of warrant
29.3

 

 

Total
(0.2
)%
 
(1.1
)%
 
(2.1
)%

(i) Starting in 2017, excess tax benefits from share-based award activity are reflected in the provision for income taxes.
The tax effects of temporary differences and related deferred tax assets and liabilities are as follows (in thousands):
 
Balance at December 31,
2017
 
2016
 
2015
Deferred tax assets:
 
 
 
 
 
Capitalized costs
$
35,608

 
$
61,897

 
$
67,051

Accrued expenses
23,553

 
29,421

 
27,964

Net operating loss carryforwards
244,197

 
65,507

 
36,633

Tax credit carryforwards
60,567

 
38,927

 
25,349

Property, equipment and intangible assets
7,390

 
5,721

 

Share-based compensation
35,728

 
52,091

 
36,689

Other
2,519

 
1,640

 
1,469

Total deferred tax assets
409,562

 
255,204

 
195,155

Valuation allowance
(409,043
)
 
(254,898
)
 
(195,103
)
Total deferred tax assets, net of valuation allowance
519

 
306

 
52

Deferred tax liabilities:
 
 
 
 
 
Property, equipment and intangible assets
(644
)
 
(476
)
 
(163
)
Total deferred tax liabilities
(644
)
 
(476
)
 
(163
)
Net deferred tax liabilities
$
(125
)
 
$
(170
)
 
$
(111
)

        
On December 22, 2017, the U.S. government enacted comprehensive tax legislation commonly referred to as the Tax Cuts and Jobs Act ("2017 Tax Act"). The 2017 Tax Act makes broad and complex changes to the U.S. tax code, including, but not limited to, (1) reducing the U.S. Federal corporate tax rate from 35% to 21%; (2) requiring companies to pay a one-time transition tax on certain unrepatriated earnings of foreign subsidiaries; (3) in part eliminating U.S. Federal income taxes on dividends from foreign subsidiaries; (4) requiring a current inclusion in U.S. Federal taxable income of certain unrepatriated earnings of controlled foreign corporations; (5) eliminating the corporate alternative minimum tax ("AMT") and changing how existing AMT credits can be realized; (6) creating the base erosion anti-abuse tax ("BEAT"), a new minimum tax; (7) creating a new limitation on deductible interest expense; and (8) changing rules related to uses and limitations of net operating loss carryforwards created in tax years beginning after December 31, 2017.
In connection with the Company's analysis of the impact of the 2017 Tax Act, it recorded a net tax benefit of $1.3 million in the period ended December 31, 2017. The net benefit consists of the release of the valuation allowance on the Company's AMT credit carryforward, which will be refunded in tax years 2018-2021. In addition, the 2017 Tax Act reduces the corporate tax rate to 21%, effective January 1, 2018. Consequently, the Company has recorded a decrease of $63.6 million, with an offset to the valuation allowance, to its U.S. Federal and state deferred tax assets. The Company has also completed its analysis of the deemed repatriation transition tax and has concluded that it will not owe any transition tax. Additionally, on December 22, 2017, the SEC staff issued Staff Accounting Bulletin No. 118 ("SAB 118") to address the application of U.S. GAAP in situations when a registrant does not have the necessary information available, prepared, or analyzed (including computations) in reasonable detail to complete the accounting for certain income tax effects of the 2017 Tax Act. The Company has recognized the tax impacts related to refundable AMT credits and revaluation of deferred tax assets, offset by the valuation allowance, and included these amounts in its consolidated financial statements for the year ended December 31, 2017. The ultimate impact may differ from the amounts recorded due to, among other things, additional analysis, changes in interpretations and assumptions as applicable, and additional regulatory guidance that may be issued. Any difference is not expected to be material. The accounting is expected to be complete when the 2017 U.S. corporate income tax return is filed in 2018.
Realization of deferred tax assets is dependent upon the generation of future taxable income, the timing and amount of which are uncertain. Due to the history of losses generated in the U.S. and certain foreign jurisdictions, the Company believes that it is more likely than not that its deferred tax assets in these jurisdictions will not be realized as of December 31, 2017. Accordingly, the Company retained a full valuation allowance on its deferred tax assets in these jurisdictions. The amount of deferred tax assets considered realizable in future periods may change as management continues to reassess the underlying factors it uses in estimating future taxable income.

The valuation allowance increased by approximately $154.1 million, $59.8 million, and $69.7 million during the years ended December 31, 2017, 2016, and 2015, respectively.

As of December 31, 2017, the Company had $774.2 million of Federal, $594.2 million of state, and $131.7 million of foreign net operating loss carryforwards, which will begin to expire in 2035 for Federal and 2021 for state tax purposes. The foreign net operating loss carryforwards do not expire.
As of December 31, 2017, the Company had $42.6 million of Federal, $31.1 million of state, and $1.6 million of Canadian research credit carryforwards. The Federal credit carryforward will begin to expire in 2029, the state credit carryforward has no expiration date, and the Canadian credit carryforward will begin to expire in 2035.
The Company also has a Federal AMT credit carryforward of $1.3 million that will be refunded over the 2018-2021 tax years under the 2017 Tax Act. The Company has California Enterprise Zone credit carryforwards of $2.8 million, which will begin to expire in 2023.
Utilization of the net operating loss carryforwards and credits may be subject to annual limitations due to the ownership change limitations provided by the Internal Revenue Code of 1986, as amended, and similar state provisions. The annual limitations may result in the expiration of net operating losses and credits before they are able to be utilized. The Company does not expect any previous ownership changes, as defined under Section 382 and 383 of the Internal Revenue Code, to result in a limitation that will reduce the total amount of net operating loss carryforwards and credits that can be utilized.
As of December 31, 2017, the unrecognized tax benefit was $70.8 million, of which $4.5 million would impact the annual effective tax rate if recognized and the remainder of which would result in a corresponding adjustment to the valuation allowance.
A reconciliation of the beginning and ending amount of unrecognized tax benefit is presented below (in thousands):

 
Year Ended December 31,
2017
 
2016
 
2015
Balance at the beginning of the year
$
92,134

 
$
90,372

 
$
78,031

Gross increases and decreases related to prior period tax positions

 
5,190

 

Gross increases and decreases related to current period tax positions
4,193

 
(3,428
)
 
12,341

Reductions related to lapse of statute of limitations
(91
)
 

 

Gross increases and decreases related to U.S. tax reform
(25,437
)
 

 

Balance at the end of the year
$
70,799

 
$
92,134

 
$
90,372



The Company recognizes interest and penalties related to income tax matters as a component of income tax expense. As of December 31, 2017, there were no significant accrued interest and penalties related to uncertain tax positions. It is reasonably possible that over the next 12-month period the Company may experience a decrease in its unrecognized tax benefits as a result of tax examinations or lapses of statute of limitations. The estimated decrease in unrecognized tax benefits may range up to $13 million.
The Company is subject to taxation in the United States and various state and foreign jurisdictions. The Company is currently under examination in California for tax years 2013 and 2014 and other jurisdictions for tax years 2013-2016. The Company’s various tax years starting with 2009 to 2016 remain open in various taxing jurisdictions.
As of December 31, 2017, the Company has not provided deferred U.S. income taxes or foreign withholding taxes on temporary differences resulting from earnings for certain non-U.S. subsidiaries, which are permanently reinvested outside the U.S. Cumulative undistributed earnings for these non-U.S. subsidiaries as of December 31, 2017 are $4.1 million. Furthermore, the Company has accumulated deficits such that no U.S. tax is expected to be due as a result of U.S. tax reform related to IRC Section 965.