{"version":3,"sources":["jsdelivr-header.js","/npm/spokestack-react-native@0.0.4/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCLI,mBACA,kBACG,eAEP,MAAM,WAAE,YAAe,cACjB,kBAAoB,IAAI,mBAAmB,YAEjD,MAAM,aAGJ,WAAA,GACE,KAAK,SAAU,EACf,KAAK,WAAa,KAClB,KAAK,QAAU,CACb,cAAiB,KAAK,eAAe,KAAK,MAE9C,CAEA,OAAA,GACM,KAAK,aACP,KAAK,WAAW,KAAI,CAAC,EAAU,IAAU,EAAS,WAClD,KAAK,WAAa,KAEtB,CAEA,UAAA,CAAY,GACL,KAAK,SAAY,KAAK,aACzB,KAAK,WAAa,OAAO,KAAK,KAAK,SAChC,KAAI,CAAC,EAAK,IAAU,kBAAkB,YAAY,EAAK,KAAK,QAAQ,OAKzE,WAAW,WAAW,EACxB,CAEA,KAAA,GACE,WAAW,OACb,CAEA,IAAA,GACE,WAAW,MACb,CAIA,cAAA,CAAgB,GACd,OAAQ,EAAE,MAAM,eACd,IAAK,WACC,KAAK,iBACP,KAAK,gBAAgB,GAEvB,MACF,IAAK,aACC,KAAK,eACP,KAAK,cAAc,GAErB,MACF,IAAK,YACC,KAAK,oBACP,KAAK,mBAAmB,GAMhC,EAGF,OAAO,QAAU,IAAI","file":"/npm/spokestack-react-native@0.0.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/spokestack-react-native@0.0.4/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import {\n    NativeEventEmitter,\n    NativeModules\n} from 'react-native'\n\nconst { Spokestack } = NativeModules\nconst spokestackEmitter = new NativeEventEmitter(Spokestack)\n\nclass RNSpokestack {\n  // Class methods\n\n  constructor () {\n    this._loaded = false\n    this._listeners = null\n    this._events = {\n      'onSpeechEvent': this._onSpeechEvent.bind(this)\n    }\n  }\n\n  destroy () {\n    if (this._listeners) {\n      this._listeners.map((listener, index) => listener.remove())\n      this._listeners = null\n    }\n  }\n\n  initialize (pipelineConfig) {\n    if (!this._loaded && !this._listeners) {\n      this._listeners = Object.keys(this._events)\n        .map((key, index) => spokestackEmitter.addListener(key, this._events[key]))\n    }\n\n    // I also don’t want to have to provide a fixed list of aliases inside the framework. so we may just have to set up a mapping section inside the config that maps logical names to ios/android component names\n\n    Spokestack.initialize(pipelineConfig)\n  }\n\n  start () {\n    Spokestack.start()\n  }\n\n  stop () {\n    Spokestack.stop()\n  }\n\n  // Events\n\n  _onSpeechEvent (e) {\n    switch (e.event.toLowerCase()) {\n      case 'activate':\n        if (this.onSpeechStarted) {\n          this.onSpeechStarted(e)\n        }\n        break\n      case 'deactivate':\n        if (this.onSpeechEnded) {\n          this.onSpeechEnded(e)\n        }\n        break\n      case 'recognize':\n        if (this.onSpeechRecognized) {\n          this.onSpeechRecognized(e)\n        }\n        break\n      default:\n        break\n    }\n  }\n}\n\nmodule.exports = new RNSpokestack()\n"]}