{"version":3,"sources":["jsdelivr-header.js","/npm/@claudemuller/postfix-calculator@1.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,SAAS,aAAa,GACpB,IAAI,EAAQ,GA6BZ,OA3BA,EAAK,SAAS,IACZ,GAAI,SAAS,GACX,EAAM,KAAK,OACN,CACL,MAAM,EAAM,EAAM,MACZ,EAAM,EAAM,MAElB,OAAQ,GACN,IAAK,IACH,EAAM,KAAK,EAAM,GACjB,MACF,IAAK,IACH,EAAM,KAAK,EAAM,GACjB,MACF,IAAK,IACH,EAAM,KAAK,EAAM,GACjB,MACF,IAAK,IACH,EAAM,KAAK,EAAM,GACjB,MACF,IAAK,IACH,EAAM,KAAK,EAAM,GAGvB,KAGK,EAAM,KACf,CAEA,OAAO,QAAU","file":"/npm/@claudemuller/postfix-calculator@1.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@claudemuller/postfix-calculator@1.0.1/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","'use strict';\n\nfunction calculate(...args) {\n  let stack = [];\n\n  args.forEach((arg) => {\n    if (parseInt(arg)) {\n      stack.push(arg);\n    } else {\n      const lhs = stack.pop();\n      const rhs = stack.pop();\n\n      switch (arg) {\n        case '+':\n          stack.push(rhs + lhs);\n          break;\n        case '-':\n          stack.push(rhs - lhs);\n          break;\n        case '*':\n          stack.push(rhs * lhs);\n          break;\n        case '/':\n          stack.push(rhs / lhs);\n          break;\n        case '%':\n          stack.push(rhs % lhs);\n          break;\n      }\n    }\n  });\n\n  return stack.pop();\n}\n\nmodule.exports = calculate;\n"]}