$ = jQuery
context = window
logger = context.JK.logger

@PlatformStore = Reflux.createStore(
  {
    logger: context.JK.logger
    os: null
    serial_no: null

    init: ->
      this.listenTo(context.AppStore, this.onAppInit)

    jamblasterSerialNo: () ->

      if @serial_no?
        return @serial_no

      if context.jamClient && context.jamClient.jamBlasterSerialNo
        @serial_no = context.jamClient.jamBlasterSerialNo()
      else
        @serial_no= false

      @serial_no

    onAppInit: (@app) ->
      @os = context.jamClient.GetOSAsString()
      this.trigger({os: @os, isWindows: @isWindows()})

    isWindows: ->
      @os == 'Win32'

  }
)