{"version":3,"sources":["jsdelivr-header.js","/npm/gulp-docker-notify@0.1.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,QAAU,QAAQ,YAClB,SAAW,QAAQ,mBACnB,YAAc,QAAQ,gBACtB,MAAQ,QAAQ,SAEpB,MAAM,YAAc,qBAEpB,SAAS,iBAAiB,GACxB,MAAM,EAAU,OAAO,KAAK,GACtB,EAAS,MAAM,aAAa,QAClC,EAAO,KAAK,EAAS,KAAM,cAAe,IACxC,EAAO,OAAO,GAElB,CAEA,SAAS,iBAAiB,EAAO,EAAc,GAAI,GAAQ,GAEzD,IAAK,EACH,MAAM,IAAI,YAAY,YAAa,yCAGrC,OAAO,QAAQ,KAAI,SAAU,EAAM,EAAK,GAEtC,GAAI,EAAK,SACP,OAAO,EAAG,KAAM,GAGlB,IAAI,EAAU,CACZ,MAAS,SAAS,EAAT,CAAgB,CAAE,KAAM,IACjC,YAAe,SAAS,EAAT,CAAsB,CAAE,KAAM,IAC7C,MAAS,GAGX,iBAAiB,KAAK,UAAU,IAEhC,EAAG,KAAM,EACX,GAEF,CAGA,OAAO,QAAU","file":"/npm/gulp-docker-notify@0.1.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/gulp-docker-notify@0.1.0/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","var through = require('through2');\nvar template = require('lodash.template');\nvar PluginError = require('plugin-error');\nvar dgram = require('dgram');\n\nconst PLUGIN_NAME = 'gulp-docker-notify';\n\nfunction sendNotification(messageString) {\n  const message = Buffer.from(messageString);\n  const client = dgram.createSocket('udp4');\n  client.send(message, 9090, '172.17.0.1', (err) => {\n    client.close();\n  });\n}\n\nfunction gulpDockerNotify(title, information = \"\", error = false) {\n\n  if (!title) {\n    throw new PluginError(PLUGIN_NAME, 'Your notification is missing a title.');\n  }\n\n  return through.obj(function (file, enc, cb) {\n\n    if (file.isNull()) {\n      return cb(null, file);\n    }\n\n    var message = {\n      \"title\": template(title)({ file: file }),\n      \"information\": template(information)({ file: file }),\n      \"error\": error\n    }\n\n    sendNotification(JSON.stringify(message));\n\n    cb(null, file);\n  });\n\n}\n\n// Exporting the plugin main function\nmodule.exports = gulpDockerNotify;\n"]}