   activeLeavingSharedMachineId: ActiveLeavingSharedMachineIdStore
   differentStackResourcesStore : DifferentStackResourcesStore
   teamStackTemplates
+  privateStackTemplates
   inUseTeamStackTemplates
+  inUsePrivateStackTemplates
 }

DifferentStackResourcesStore      = ['DifferentStackResourcesStore']
ActiveStackStore                  = ['ActiveStackStore']
TeamStackTemplatesStore           = ['TeamStackTemplatesStore']


workspacesWithChannels = [

        .set 'isDefault', template.get('_id') in (getGroup().stackTemplates or [])
]

privateStackTemplates = [
  PrivateStackTemplatesStore
  stacks
  (templates, _stacks) ->
    baseStackIds = _stacks.toList().toArray().map (s) -> s.get 'baseStackId'
    templates.map (template) ->
      template
        .set 'inUse', template.get('_id') in baseStackIds
        .set 'isDefault', template.get('_id') in (getGroup().stackTemplates or [])
]

inUseTeamStackTemplates = [
  teamStackTemplates
  (templates) -> templates.filter (t) -> t.get('inUse')
]

inUsePrivateStackTemplates = [
  privateStackTemplates
  (templates) -> templates.filter (t) -> t.get('inUse')
]

