{"version":3,"sources":["jsdelivr-header.js","/npm/enclout-node@1.0.0/enclout.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,IAAI,QAAU,QAAQ,WAClB,QAAU,QAAQ,WAClB,UAAY,QAAQ,0BAExB,SAAS,eAAgB,EAAS,EAAY,GAC5C,IAAI,EAAM,EAAW,EAAM,GAa3B,OAXc,IAAI,SAAQ,SAAU,EAAS,GAC3C,QAAQ,GAAK,SAAU,EAAK,EAAM,GAC5B,EACF,EAAO,IAAI,MAAM,EAAI,UAEC,KAAf,EAAK,QAAgC,KAAf,EAAK,QAAgC,KAAf,EAAK,OACxD,EAAO,IAAI,MAAM,wBAEd,EAAQ,KAAK,MAAM,GAC1B,GACF,GAEF,CAEA,OAAO,QAAU,SAAU,GACzB,MAAO,CACL,SAAU,QAAQ,eAAR,CAAwB,EAAxB,CAAiC,UAAU,cACrD,aAAc,QAAQ,eAAR,CAAwB,EAAxB,CAAiC,UAAU,cAE7D","file":"/npm/enclout-node@1.0.0/enclout.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/enclout-node@1.0.0/enclout.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict'\nvar curryJs = require('curryjs')\nvar request = require('request')\nvar urlHelper = require('./helper/encloutHelper')\n\nfunction genericApiCall (authKey, urlBuilder, text) {\n  var url = urlBuilder(text, authKey)\n  //console.log(url)\n  var promise = new Promise(function (resolve, reject) {\n    request(url, function (err, resp, body) {\n      if (err){\n        reject(new Error(err.message))\n      }\n      else if (resp.status == 404 || resp.status == 503 || resp.status == 500){\n        reject(new Error('Status Code not 200'))\n      }\n      else resolve(JSON.parse(body))\n    })\n  })\n  return promise\n}\n\nmodule.exports = function (authKey) {\n  return {\n    stemming: curryJs(genericApiCall)(authKey)(urlHelper.buildStemUrl),\n    termAnalysis: curryJs(genericApiCall)(authKey)(urlHelper.buildTermUrl)\n  }\n}\n"]}