<div class="card card-body bg-light top-level">
	<h2>Totals</h2>
	Direct Link: <a target="_blank" [href]="totalsURL">{{ totalsURL }}</a>
	<div class="card card-body"><pre>{{ tsj | json }}</pre></div>
</div>
<div *ngIf="totals.substances || totals.values" class="card card-body bg-light top-level">
	<div ngbDropdown class="d-inline-block mr-1">
		<button class="btn btn-outline-primary" id="dm_dropdown" ngbDropdownToggle>Data: {{dmDisplay}}</button>
		<div ngbDropdownMenu aria-labelledby="dm_dropdown">
			<button *ngFor="let dataMode of dataModes" class="dropdown-item" [class.active]="dataMode.dm === dm" (click)="dm=dataMode.dm"><app-data-mode [dataMode]="dataMode"></app-data-mode></button>
		</div>
	</div>
	<div ngbDropdown class="d-inline-block">
		<button class="btn btn-outline-primary" id="format_dropdown" ngbDropdownToggle>Format: {{format.displayAbbr}}</button>
		<div ngbDropdownMenu aria-labelledby="format_dropdown">
			<button *ngFor="let f of formats" type="button" class="dropdown-item" (click)="format=f">{{f.display}}</button>
		</div>
	</div>
	<app-json-data [search]="search" [totals]="totals" [dm]="dm" [fmt]="format.fmt" ></app-json-data>
</div>