{"version":3,"sources":["jsdelivr-header.js","/npm/@ssh-uppy/store-default@1.2.1/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,yOCHM,a,WAGJ,SAAA,IACE,KAAK,MAAQ,GACb,KAAK,UAAY,EAClB,C,2BAED,SAAA,WACE,OAAO,KAAK,KACb,E,EAED,SAAA,SAAU,GACR,IAAM,EAAY,SAAc,GAAI,KAAK,OACnC,EAAY,SAAc,GAAI,KAAK,MAAO,GAEhD,KAAK,MAAQ,EACb,KAAK,SAAS,EAAW,EAAW,EACrC,E,EAED,UAAA,SAAW,GAAU,IAAA,EAAA,KAEnB,OADA,KAAK,UAAU,KAAK,GACb,WAEL,EAAK,UAAU,OACb,EAAK,UAAU,QAAQ,GACvB,EAEH,CACF,E,EAED,SAAA,WAAmB,QAAA,EAAA,UAAA,OAAN,EAAM,IAAA,MAAA,GAAA,EAAA,EAAA,EAAA,EAAA,IAAN,EAAM,GAAA,UAAA,GACjB,KAAK,UAAU,SAAQ,SAAC,GACtB,EAAQ,WAAR,EAAY,EACb,GACF,E,KAnCG,aACG,QAAU,QAAQ,mBAAmB,QAqC9C,OAAO,QAAU,WACf,OAAO,IAAI,YACZ","file":"/npm/@ssh-uppy/store-default@1.2.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@ssh-uppy/store-default@1.2.1/lib/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","/**\n * Default store that keeps state in a simple object.\n */\nclass DefaultStore {\n  static VERSION = require('../package.json').version\n\n  constructor () {\n    this.state = {}\n    this.callbacks = []\n  }\n\n  getState () {\n    return this.state\n  }\n\n  setState (patch) {\n    const prevState = Object.assign({}, this.state)\n    const nextState = Object.assign({}, this.state, patch)\n\n    this.state = nextState\n    this._publish(prevState, nextState, patch)\n  }\n\n  subscribe (listener) {\n    this.callbacks.push(listener)\n    return () => {\n      // Remove the listener.\n      this.callbacks.splice(\n        this.callbacks.indexOf(listener),\n        1\n      )\n    }\n  }\n\n  _publish (...args) {\n    this.callbacks.forEach((listener) => {\n      listener(...args)\n    })\n  }\n}\n\nmodule.exports = function defaultStore () {\n  return new DefaultStore()\n}\n"]}